| Store | Cart

Re: [TCLCORE] CFV: TIP #435

From: Alexandre Ferrieux <alex...@gmail.com>
Mon, 3 Aug 2015 18:53:02 +0200
On Mon, Aug 3, 2015 at 6:34 PM, Gustaf Neumann <neum...@wu.ac.at> wrote:

> pthread_atfork() is called only once per process, its callbacks cannot> be unregistered.>


That's a sad under-design on libpthread's part, ain't it ? ;-)
But the Tcl library, among other things, somehow ambitions to be a "better
libc" (at least at times).
So, what about fixing that wart:

    - call once and for all early in Tcl's init (like T_FE)
pthread_atfork(TclAtforkHandler)
    - let TclAtForkHandler be:

          lock(&atfmutex);
          for(p=atflist;p;p=p->next) p();
          unlock(&atfmutex);

     - of course a couple of convenience routine would allow to add/remove
callbacks to atflist any time, in a thread-safe way thanks to atfmutex

-Alex

------------------------------------------------------------------------------

_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core

Recent Messages in this Thread
Gustaf Neumann Aug 09, 2015 06:20 pm
Alexandre Ferrieux Aug 10, 2015 01:42 pm
Gustaf Neumann Aug 10, 2015 02:55 pm
Jan Nijtmans Aug 26, 2015 01:34 pm
Alexandre Ferrieux Aug 08, 2015 10:38 am
Gustaf Neumann Aug 08, 2015 08:33 am
Alexandre Ferrieux Aug 08, 2015 10:21 am
Alexandre Ferrieux Aug 06, 2015 06:20 pm
Gustaf Neumann Aug 07, 2015 08:37 am
Alexandre Ferrieux Aug 07, 2015 11:24 pm
Joe English Jul 27, 2015 07:39 pm
Gustaf Neumann Jul 28, 2015 10:38 pm
Gustaf Neumann Jul 31, 2015 10:16 pm
Massimo Manghi Aug 02, 2015 08:09 am
Alexandre Ferrieux Aug 03, 2015 10:03 am
Massimo Manghi Aug 03, 2015 01:16 pm
Gustaf Neumann Aug 03, 2015 04:34 pm
Alexandre Ferrieux Aug 03, 2015 04:53 pm
Gustaf Neumann Aug 03, 2015 05:36 pm
Alexandre Ferrieux Aug 03, 2015 07:15 pm
Gustaf Neumann Aug 04, 2015 11:08 am
Alexandre Ferrieux Aug 04, 2015 11:37 am
Gustaf Neumann Aug 04, 2015 12:23 pm
Alexandre Ferrieux Aug 04, 2015 04:36 pm
Massimo Manghi Aug 04, 2015 11:20 pm
Gustaf Neumann Aug 06, 2015 05:50 pm
Alexandre Ferrieux Aug 06, 2015 06:13 pm
Gustaf Neumann Aug 06, 2015 05:31 pm
Jan Nijtmans Aug 06, 2015 03:49 am
Gustaf Neumann Aug 07, 2015 06:47 pm
Donal K. Fellows Jul 26, 2015 11:09 am
bch Jul 27, 2015 07:46 pm
Messages in this thread