threads and processes
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > threads and processes




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    threads and processes  
rahul8143@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-18-05 12:47 PM

hello,
How linux schedules,executes processes and threads with respect to
OS? I mean if say process A is executing then if it creates 2 threads
and similaraly there are other processes in system currently then how
OS schedules them?
Also does each thread of a process has a its PID? Does in a
multithreaded program all its threads have PID?
regards,
rahul






[ Post a follow-up to this message ]



    Re: threads and processes  
Kasper Dupont


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-18-05 10:55 PM

rahul8143@gmail.com wrote:
>
> hello,
>     How linux schedules,executes processes and threads with respect to
> OS? I mean if say process A is executing then if it creates 2 threads
> and similaraly there are other processes in system currently then how
> OS schedules them?

They are scheduled like all other threads on the system.
Each thread get a time slice, the higher the nice value is
the shorter a slice the thread gets. The scheduler will try
to give threads sharing address space their slices just after
each other to reduce the number of TLB flushes.

> Also does each thread of a process has a its PID? Does in a
> multithreaded program all its threads have PID?

Each thread have an ID, not all people agree on what to call
that ID. You can get both the ID of the individual thread and
the ID of the group. The getpid() system call used to give
the ID of the thread, but in newer kernels give the ID of the
group.

--
Kasper Dupont
Note to self: Don't try to allocate
256000 pages with GFP_KERNEL on x86.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:36 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register