[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libpthread: caching of data structures and kernel resources

From: Neal H. Walfield
Subject: Re: libpthread: caching of data structures and kernel resources
Date: Fri, 10 Aug 2012 19:55:13 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Fri, 10 Aug 2012 09:15:01 +0200,
Neal H. Walfield wrote:
> > Why does Viengoos in
> > sysdeps/viengoos/pt-thread-halt.c:__pthread_thread_halt have to do
> > different things depending on whether »thread == _pthread_self« or not?
> > I'm assuming that on Mach, we can just always do thread_suspend (and take
> > care to do a thread_abort before re-using it)?
> My recollection is that they are semantically equivalent in this case
> (vg_suspend cause the calling thread to wait for a message;
> vg_thread_stop marks the thread as not runnable), but vg_suspend is a
> lot cheaper than vg_thread_stop.

I now remember the main motivation for this.  Modifying a thread is an
RPC, i.e., a reply is sent.  When a thread stops itself, any reply
will be dropped.  As this is normally an error, Viengoos dumped a fair
amount of debugging output when this condition occurred.  To avoid
this gratuitous output, I used vg_suspend instead.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]