Article View: comp.os.mach
Article #1307cthreads and queues
From: Shu-Wie F Chen
Date: Fri, 02 Mar 1990 14:42
Date: Fri, 02 Mar 1990 14:42
30 lines
1895 bytes
1895 bytes
I am posting this for a friend.
-------------------------------------------------------------------------------
assume you have 3 threads in c-threads. 2 of them do a call.. but the
third is not ready to accept yet. So we want the 2 of them to wait. The
easiest way to make them wait in c-threads is a conditional_wait(accept_ready)
, now both of the calling threads are waiting on the condition when the 3rd
thread is ready to accept. When the third thread signals conditional_signal
(accept_ready) only one of the thread will be awakened, the c-threads manual
states that 'at least one of them will be awakened' but does not specify
which one...
here is my question: If c1 was put on the condition_wait first before c2,
then when c3 is ready to accept will c-threads' implicit queue take care of
c1 getting the control of c3 first since it was put on the condition_wait
first. if not, is there a way to implement this queue.. so that at least a
fair amount of fairness can be obtained with a FIFO queue. The c-threads
maunal does not specify if c-threads does an FIFO queue on a
conditional_signal.
-------------------------------------------------------------------------------
Thanks.
*swfc
-------------------------------------------------------------------------------
Shu-Wie F Chen Department of Computer Science
swfc@cs.columbia.edu Columbia University
Technical Details
Message-ID:
<SWFC.90Mar2094255@mendelssohn.cs.columbia.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cs.columbia.edu!cs!swfcShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cs.columbia.edu!cs!swfc From: swfc@mendelssohn.cs.columbia.edu (Shu-Wie F Chen) Newsgroups: comp.os.mach Subject: cthreads and queues Message-ID: <SWFC.90Mar2094255@mendelssohn.cs.columbia.edu> Date: 2 Mar 90 14:42:55 GMT Sender: news@cs.columbia.edu (The Daily News) Distribution: usa Organization: Columbia University Computer Science Lines: 30