Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2003 09:39:31 +0200
From:      "Kai Mosebach" <kai.mosebach@freshx.de>
To:        <freebsd-threads@freebsd.org>
Subject:   Kse/Thr _exit implementation
Message-ID:  <000401c346b6$67b911c0$0100a8c0@alpha>

next in thread | raw e-mail | index | archive | help
Hi again,

i have two other questions regarding the kse/thr implementation:

1.) often i see, that the linuxthreads implematation has problems with
the
exit() function, if not all threads are finished. Is this fixed in kse ?

2.) i found this piece of code in the sapdb, which had to be enabled,
when i used linuxthreads, but with kse it just loops around, so i
removed it. Is this problem described here lthreads only ?

cheers 

------------------------snip

#if defined LINUX || (defined FREEBSD && defined LINUXTHREADS &&
!defined FREEBSD_THREADS)
    if ( pThreadObj->StackSize != 0 ) /* PTS 1106187 */
    {
    /*
     * Some words.... PTS 1105262/1105263
     * There was a LINUX specific crash without this YIELD_CALL loop.
The linuxthread 
     * pthread manager does not synchronize the pthread_join() call with
the actions
     * of freeing internal references to the joined thread. Since these
references are
     * situated on the pthread stack, freeing this stack results in
program crashes depending
     * on the scheduling. Forcing the join to wait until the thread
actually was terminating
     * solves part of this problem. Creating another dummy thread solves
the synchronization.
     */
    /* PTS 1105678 poll after join not before join... and use kill
instead of pthread_kill */
      while ( kill( pThreadObj->thread_id, 0) == 0 )
      {
        sleep(1); /* YIELD_CALL; */ /* let him finsh */
      }
    }
#endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000401c346b6$67b911c0$0100a8c0>