Hi Lalit,
I my opinion conditional variables along with mutexes are the only mean by which you can control the ordering of the threads. You are right that it is the schduler which controls the allocation of CPU to the processes. But if you are doing a "wait" on the condition variable in a thread, it will not be acquire the CPU unless a conditional "signal" is sent to that thread. 
 
Regards
Prabhat 
-----Original Message-----
From: Lalit Kumar Bhasin [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 1:16 PM
To: multiple recipients of
Subject: [ilugd]: order of execution of threads

Hi,
 
 Using Linux threads / pthreads, is there any way of controlling the order of thread execution.
 Suppose u have T1,T2,T3. The order should be (say),
 
T1T2T1T2T1T2T3T1T2T1T2T1T2T1T2T3......
 
Dont tell me thru the 'condition' variable, as it does not controls the order, which is the prerogative of the scheduler.
 
Regds,
Lalit
 

Reply via email to