Kse/Thr _exit implementation

David Xu davidxu at viatech.com.cn
Thu Jul 10 01:22:04 PDT 2003


----- Original Message ----- 
From: "Kai Mosebach" <kai.mosebach at freshx.de>
To: <freebsd-threads at freebsd.org>
Sent: Thursday, July 10, 2003 3:39 PM
Subject: Kse/Thr _exit implementation


> 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 ?
> 

exit() is OK on FreeBSD for multiple threads process, I never heard
threaded process has exit() problem with libkse/libthr.

> 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
> 
> _______________________________________________
> freebsd-threads at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe at freebsd.org"
> 


More information about the freebsd-threads mailing list