From owner-freebsd-arch@FreeBSD.ORG Mon Jul 7 07:51:15 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA9A9106566C for ; Mon, 7 Jul 2008 07:51:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 6CD4E8FC1E for ; Mon, 7 Jul 2008 07:51:15 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id 6FE8A170E3; Mon, 7 Jul 2008 07:51:13 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m677pCCD004220; Mon, 7 Jul 2008 07:51:12 GMT (envelope-from phk@critter.freebsd.dk) To: Sergey Babkin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 06 Jul 2008 18:34:14 -0400." <48714866.906912CC@verizon.net> Date: Mon, 07 Jul 2008 07:51:12 +0000 Message-ID: <4219.1215417072@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: arch@freebsd.org Subject: Re: Proposal: a revoke() system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 07:51:15 -0000 In message <48714866.906912CC@verizon.net>, Sergey Babkin writes: >Hi all, > >I want to propose a system call with the following functionality: > >Syntax: > > int revoke(int fd, int flags) We already have a revoke(2) system call, so the name will have to be something different. >Rationale: > >In the multithreaded programs often multiple threads work with the >same file descriptor. A particularly typical situation is a reader >thread and a writer thread. The reader thread calls read(), gets >blocked until it gets more data, then processes the data and >continues the loop. Another example of a "reader thread" would be >the main thread of a daemon that accepts the incoming connections >and starts new per-connection threads. Have you tried to implement the functionality you're asking for ? You'll have to hunt down into all sorts of protocols, drivers and other code to find the threads sleeping on your fd so you can wake them. It may be quite a piece of work. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.