Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-07-2008, 10:14 AM
Philip Guenther
 
Posts: n/a
Default Re: rthreads patch #7: redirect kill(getpid(), sig) to the current thread

On Tue, May 6, 2008 at 6:46 AM, Ted Unangst <ted.unangst@gmail.com> wrote:
> On 5/6/08, Philip Guenther <guenther@gmail.com> wrote:
> > That's true of pthreads, but not of rthreads. Currently with
> > rthreads, kill(getpid(),sig) will send the signal to the main thread,
> > period. If the main thread has the signal blocked then it'll be left
> > pending there, even if the current thread doesn't have it blocked.

>
> oops. I forget now if that was intentional or just implementation
> fallout, but Mark's right, we should fix this in the kernel. The
> library is the wrong place to workaround this.



Yep. To quote myself:
> There has to be some way to differentiate between
> kill(getpid(), sig);
> and
> raise(sig); [in the original thread]
>
> in the kernel. There are two ways to do that:
> 1) give the main thread an id distinct from that of the process, or
> 2) use distinct system calls for pthread_kill() and kill().
>
> The former has the advantage of being generic for any other cases
> where there may be a pid vs thread-id distinction. The latter would
> convey the intent of the call more clearly, perhaps simplifying the
> checks in each case.


What's your preference?

Philip Guenther

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62