From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,57421e52a70d7deb,start X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-08-02 13:49:34 PST Path: gmd.de!xlink.net!sol.ctr.columbia.edu!usc!cs.utexas.edu!uunet!noc.near.net!sunfish.hi.com!duca.hi.com!not-for-mail From: wright@duca.hi.com (David Wright) Newsgroups: comp.unix.osf.misc Subject: Re: Looking for info on threads usage Date: 2 Aug 1993 16:06:52 -0000 Organization: Hitachi Computer Products, OSSD division Message-ID: <23js4sINNsjt@duca.hi.com> References: <23912uINNnu9@duca.hi.com> NNTP-Posting-Host: duca.hi.com Keywords: pthreads, signal In article gjb@fig.citib.com (Greg Brail) writes: >In article <23912uINNnu9@duca.hi.com> wright@duca.hi.com (David Wright) writes: >> >>I'm seeking informed opinion about the usage of DCE threads and other >>pthreads implementations. Specifically, I've ported DCE threads to >>our OSF/1, using kernel threads. This seems to work fine (after I >>removed quite a few nasty bugs), but it does have the limitation that >>we don't support priority setting or policy setting. > >Not all DCE implementations support thread priorities, or even policy >setting (assuming by that you mean policies for mutex locks and >condition variables). I regard the thread priority stuff as >non-portable. Well, if I read the spec correctly, the priority and policy stuff is not required of a pthreads implementation. However, if you decide to implement one of those features, there's a set of capabilities you need to include. Anyway, this answers one of my questions -- for the nonce, not allowing priority or policy setting doesn't appear to be much of a limitation. >>Also, we can't >>support applications that want to have a helper thread in the >>background to intercept asynchronously-generated signals (e.g. quit). >Does this mean you don't support sigwait()? The other DCE >implementations I've use require the use of sigwait instead of other >signal-handling interfaces. I usually do this by spawning a thread >that calls sigwait and waits for a signal (hence the name :-) ). How >does your threading system support signals? It's awfully useful to be >able to catch them. I can see restricting usage of signals like SIGVTALRM >and SIGIO like some DCE implementations do, but reliable DCE programs >should be able to catch signals like SIGINT and SIGTERM to handle >reliable shutdown. We support sigwait(), but only for the original thread in a process. That's because all asynchronously-generated signals are fed to that thread. Any child threads can only receive synchronously-generated signals (e.g. SIGILL, SIGFPE). This is how our Mach implementation (OSF/1) does it. I have ground my teeth about this more than once, but for now we're stuck with it. This is the reason we can't do signal_to_cancel_np; that call wants to spawn off a child thread to act as a signal interceptor, which in our setup it is incapable of doing. So, in conclusion, do you (or anyone else -- don't be shy, speak right up!) think this is a serious limitation? I'd hate to go to user threads now if I don't have to. -- David Wright, Hitachi Computer Products (America), Inc. Waltham, MA wright@hicomb.hi.com :: These are my opinions, not necessarily Hitachi's, though they are the opinions of all Right-Thinking People