Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7623609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:44:59+00:00 2026-05-31T04:44:59+00:00

Now I want to create three processes in my program and there are several

  • 0

Now I want to create three processes in my program and there are several threads in each process.
And each thread is infinite task, which may sleep and be waked periodically. Besides, the process has some task to do.
My questions are:

1) Do I need to set the threads as detached ? If I set the threads as detached , they seem not to run!!
But, If threads as joinable, the process has to wait the threads to exit and it can’t do its own work!!
which one should I choose?

2)What’s the scope of schedule policy ? I mean, if I set the schedule policy as FIFO, all the threads in the all processes are scheduled by FIFO policy? Or just the thread which is set with this attribute is scheduled by this policy?

3)What’s the scope of thread priority? The thread priorities are just useful in the single process, and in another process, there exist another set of thread priorities ????? And they don’t infect each other???

I would appreciate for your help! thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:45:01+00:00Added an answer on May 31, 2026 at 4:45 am

    (1) You have a coding error. A detached thread gets a time slice like everything else. If it is not running then it is something you are doing. You should post your threadfunc and the function which creates the threads in another question.

    It’s impossible to say whether your threads should be joinable or detached without knowing what you are doing. The main benefit of joinable threads are you know when they finish and you can check the return data. If these aren’t important to you there is no real advantage to making them joinable – other than it is marginally easier to create them because that is the default.

    If you don’t want to block in pthread_join there are strategies you can pursue. Your threads can set switches before they die, you can use condition variables, you can have a separate thread that joins the dead threads and so forth. Again, it is impossible to know what is the best strategy for your particular case.

    (2 & 3) A thread inherits the schedule policy and priority of the thread that creates it and they remain that way unless you specifically change them. The policy/priority of threads in one process are not directly related to any other process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an application which uses threads. Now when the program first starts
i want create image animation , i have 50 images with png format now
I want to create a tool tip for an image with a link now
I want to create a remote webservice for an application that is now avaliable
I want to create an SQL script that creates a database. Right now, I
I create a file in JavaScript. Now I want to be able to make
I have create my own NSOpenGLView class, right now the data that i want
I've created a WPF UserControl which contains a Button. I now want any consumer
I have created a Windows CE6 Image through Platform Builder, and I now want
Let's say I have created two objects from class foo and now want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.