Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967054AbXEGWfq (ORCPT ); Mon, 7 May 2007 18:35:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S966719AbXEGWfn (ORCPT ); Mon, 7 May 2007 18:35:43 -0400 Received: from x35.xmailserver.org ([64.71.152.41]:1321 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966550AbXEGWfm (ORCPT ); Mon, 7 May 2007 18:35:42 -0400 X-AuthUser: davidel@xmailserver.org Date: Mon, 7 May 2007 15:35:38 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Ulrich Drepper cc: Davi Arnaut , Andrew Morton , Linus Torvalds , Linux Kernel Mailing List Subject: Re: [PATCH] rfc: threaded epoll_wait thundering herd In-Reply-To: Message-ID: References: <20070504225730.490334000@haxent.com.br> <463BC3CA.6050109@haxent.com.br> <463CFA37.3020809@haxent.com.br> <463F9B68.305@haxent.com.br> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1166 Lines: 31 On Mon, 7 May 2007, Ulrich Drepper wrote: > On 5/7/07, Davi Arnaut wrote: > > See Linus's message on this same thread. > > No. I'm talking about the userlevel side, not kernel side. > > If a thread is canceled *after* it returns from the syscall but before > it reports the event to the call (i.e., while still in the syscall > wrapper, thread cancellation rules require a check there) the event is > lost. read(2) is a cancellation point too. So if the fine userspace code issues a random pthread_cancel() to a thread handling that, data is lost together with the session that thread was handling. Hmm, I wonder how the world could have functioned so far. Bottom line is, if you really want to throw random cancels to your worker threads, you better wrap them into pthread_cleanup_push(). Because otherwise, no matter where your cancel hits, you end up with a broken system. - Davide - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/