From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,5887723974c3780c X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-06-21 16:22:18 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!darwin.sura.net!udel!news.intercon.com!psinntp!ibism!gjb From: gjb@fig.citib.com (Greg Brail) Subject: Re: semop() and threads -- a bad mix ? Message-ID: Keywords: semop, parallelism, threads Sender: news@fig.citib.com Organization: Citibank IBISM References: Distribution: usa Date: Mon, 21 Jun 1993 18:48:20 GMT In article Jeffrey L. DeMent writes: >Most of the software assets assume you are using their "event loop mechanism" >which uses semop() to create an environment for the program where there is only >one blocking -- namely this semop() command (exactly like an X event loop -- in >fact, if you use X and this software, it assumes the responsibilities of the X >event loop). I looked around a little, and the documentation for the DCEs that I can find -- namely the "Programmer's Notes on HP DCE Threads," doesn't mention semop() at all. It's not in the list of thread-safe functions or the list of non-thread-safe functions, so I assume it's not thread-safe and will indeed block your whole program when you call it. Is there any way you can re-implement this thing using honest-to-God DCE locking methods like mutex locks and condition variables? (I've never used semop myself, so I don't know.) >AND IF all this is in fact true, does it not mean you cannot mix X-windows >and threads in the same binary ? No. Implementations of DCE come with thread-safe versions of most standard library functions, so library code that doesn't do anything weird (like call semop) shouldn't block your whole program. However, you usually must restrict calls to such library functions to a single thread. You can certainly use DCE and X together, but you must ensure that you make all your X calls from one and only one thread. If you need more info on DCE and X, we've made it work here and my boss said he'd mail me the instructions. greg -- Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com