Date: Thu, 10 Jul 2003 16:25:17 +0800 From: "David Xu" <davidxu@viatech.com.cn> To: "Kai Mosebach" <kai.mosebach@freshx.de>, <freebsd-threads@freebsd.org> Subject: Re: Kse/Thr _exit implementation Message-ID: <002601c346bc$cb49c030$f001a8c0@davidw2k> References: <000401c346b6$67b911c0$0100a8c0@alpha>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----=20 From: "Kai Mosebach" <kai.mosebach@freshx.de> To: <freebsd-threads@freebsd.org> Sent: Thursday, July 10, 2003 3:39 PM Subject: Kse/Thr _exit implementation > Hi again, >=20 > i have two other questions regarding the kse/thr implementation: >=20 > 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 = ? >=20 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 ? >=20 > cheers=20 >=20 > ------------------------snip >=20 > #if defined LINUX || (defined FREEBSD && defined LINUXTHREADS && > !defined FREEBSD_THREADS) > if ( pThreadObj->StackSize !=3D 0 ) /* PTS 1106187 */ > { > /* > * Some words.... PTS 1105262/1105263 > * There was a LINUX specific crash without this YIELD_CALL loop. > The linuxthread=20 > * 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) =3D=3D 0 ) > { > sleep(1); /* YIELD_CALL; */ /* let him finsh */ > } > } > #endif >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002601c346bc$cb49c030$f001a8c0>