From owner-freebsd-threads@FreeBSD.ORG Wed Jul 7 08:57:41 2004 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 3A02B16A4CE for ; Wed, 7 Jul 2004 08:57:41 +0000 (GMT) Received: from anor.ics.muni.cz (anor.ics.muni.cz [147.251.4.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 586AB43D1F for ; Wed, 7 Jul 2004 08:57:40 +0000 (GMT) (envelope-from hopet@ics.muni.cz) Received: from KLOBOUCEK (kloboucek.ics.muni.cz [147.251.3.38]) (user=hopet@META mech=LOGIN bits=0) by anor.ics.muni.cz (8.12.1/8.12.1) with ESMTP id i678vbnD026309 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 7 Jul 2004 10:57:38 +0200 From: "Petr Holub" To: Date: Wed, 7 Jul 2004 10:57:36 +0200 Message-ID: <000d01c46400$732b6d60$2603fb93@KLOBOUCEK> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Muni-Spam-TestIP: 147.251.3.38 X-Muni-Virus-Test: Clean Subject: sem_wait as cancellation point 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: Wed, 07 Jul 2004 08:57:41 -0000 Hi all, I wonder why sem_wait is not a pthread cancellation point on FreeBSD-5. According to Linux man page: Cancellation points are those points in the program execution  where  a test for pending cancellation requests is performed and cancellation is executed if positive. The following POSIX threads functions are cancellation points:    pthread_join (3)    pthread_cond_wait (3)    pthread_cond_timedwait (3)    pthread_testcancel (3)    sem_wait (3)    sigwait (3) Currently, I'm using a workaround with sem_trywait and usleep, but it's not as efficient as sem_wait being a cancellation point. Thanks a lot, Petr PS: please keep me in Cc: as I'm not member of this list. ================================================================ Petr Holub CESNET z.s.p.o. Supercomputing Center Brno Zikova 4 Institute of Compt. Science 162 00 Praha 6, CZ Masaryk University Czech Republic Botanicka 68a, 60200 Brno, CZ e-mail: Petr.Holub@cesnet.cz phone: +420-549493944 fax: +420-541212747 e-mail: hopet@ics.muni.cz