Article View: comp.os.mach
Article #999questions on C threads (part of Mach)
From: Phil Howard KA9WGN
Date: Sun, 12 May 1991 23:01
Date: Sun, 12 May 1991 23:01
26 lines
1844 bytes
1844 bytes
This question applies to the C threads library which is part of Mach. I decided to ask here since those familiar with this might be here in greater concentration. Suppose I have a master thread that forks off several slave threads. It is indeterminate when the slave threads will finish, including the order in which they will finish. How can the master thread "join" or otherwise wait for the conclusion of the first of the slave threads to finish? It seems to me that the only way to do this, given that the "join" function only addresses one thread, is to have the threads manage some shared queue upon which elements are placed to identify the ending thread. This would involve mutex's to lock on and a conditional variable for the master thread to wait on, to discover which slave thread is (or is about to) exit. My objection to doing it this way is that this seems like the kind of extra management work that a package like C threads should really have implemented in the first place. Comments? Maybe a fuller description of the goals of the C threads package that is part of Mach will make this clearer. -- /***************************************************************************\ / Phil Howard -- KA9WGN -- phil@ux1.cso.uiuc.edu | Guns don't aim guns at \ \ Lietuva laisva -- Brivu Latviju -- Eesti vabaks | people; CRIMINALS do!! / \***************************************************************************/
Technical Details
Message-ID:
<1991May12.230130.8199@ux1.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!wuarchive!uwm.edu!ux1.cso.uiuc.edu!philShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!wuarchive!uwm.edu!ux1.cso.uiuc.edu!phil From: phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) Newsgroups: comp.os.mach Subject: questions on C threads (part of Mach) Message-ID: <1991May12.230130.8199@ux1.cso.uiuc.edu> Date: 12 May 91 23:01:30 GMT Organization: University of Illinois at Urbana Lines: 26