From owner-freebsd-threads@FreeBSD.ORG Thu Jul 10 01:22:03 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D040837B401 for ; Thu, 10 Jul 2003 01:22:03 -0700 (PDT) Received: from exchhz01.viatech.com.cn (ip-167-164-97-218.anlai.com [218.97.164.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51CA843FCB for ; Thu, 10 Jul 2003 01:22:02 -0700 (PDT) (envelope-from davidxu@viatech.com.cn) Received: from davidw2k (ip-240-1-168-192.rev.dyxnet.com [192.168.1.240]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 3MLFXGNH; Thu, 10 Jul 2003 16:05:42 +0800 Message-ID: <002601c346bc$cb49c030$f001a8c0@davidw2k> From: "David Xu" To: "Kai Mosebach" , References: <000401c346b6$67b911c0$0100a8c0@alpha> Date: Thu, 10 Jul 2003 16:25:17 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Subject: Re: Kse/Thr _exit implementation X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2003 08:22:04 -0000 ----- Original Message -----=20 From: "Kai Mosebach" To: 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" >