Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: dmcco@ctp.com (David McCowan)
Subject: semop and threads
Date: Tue, 22 Jun 1993 13:49:34 GMT	[thread overview]
Message-ID: <1993Jun22.134934.9803@ctp.com> (raw)

To DCE Community,

>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).  The program continuely loops, waiting for any pre-defined event,
>(such as a SIGALRM signal from a timer function -- one of the assets they
>wrote). When the event is received, a chuck of code is executed to deal with
>the event and the program goes back to waiting (at the semop system call).
>In our environment this seems to effectively prohibit the use of threads
>because even if you create a thread to deal with the event and immediately
>go back to the loop,  the semop() call blocks the process and consequently
>the thread you just created.  In other words, as I understand it, this
>program architecture as implemented using semop() makes parallelism impossible
>and hence defeats a fundamental advantage of DCE.
>
>AND IF all this is in fact true, does it not mean you cannot mix X-windows
>and threads in the same binary ?
>

	First, the semop command that comes with the DCE thread safe library
is NOT a blocking call.  I ran a test program that created a thread and then
suspended on a semop call.  The thread slept for a few seconds, then issued
a semop call of its own to awaken the first thread.

	I don't know if you can mix X-windows with threads.  We had a 
situation where we wanted the X event loop to interrupt due to an X event or an
incoming RPC.  We did not have a lot of confidence in threads, so we forked off
a process that listened for incoming RPC's and communicated to the parent via
pipes.  

Bye,
dmcco@ctp.com 


                 reply	other threads:[~1993-06-22 13:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox