From owner-freebsd-threads@FreeBSD.ORG Thu Jul 10 00:39:33 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 5E14337B401 for ; Thu, 10 Jul 2003 00:39:33 -0700 (PDT) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id A890A43FA3 for ; Thu, 10 Jul 2003 00:39:32 -0700 (PDT) (envelope-from kai.mosebach@freshx.de) Received: from alpha (p508B1B44.dip.t-dialin.net [80.139.27.68]) by dust.freshx.de (Postfix) with ESMTP id 2E00A15E1FC for ; Thu, 10 Jul 2003 09:39:28 +0200 (CEST) From: "Kai Mosebach" To: Date: Thu, 10 Jul 2003 09:39:31 +0200 Message-ID: <000401c346b6$67b911c0$0100a8c0@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: 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 07:39:33 -0000 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