From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <16e23f18e947c3c8ea0d75d5c33bf4d3@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] new system calls - semacquire, semrelease From: Charles Forsyth Date: Sun, 26 Mar 2006 19:59:52 +0100 In-Reply-To: <775b8d190603260911h73f5b3ceqb03c5724ab95f6fb@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-eweyikyhtuylkuintquivjebvb" Topicbox-Message-UUID: 22070a48-ead1-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-eweyikyhtuylkuintquivjebvb Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit here's a different little hack that's more unix-specific, which i borrowed from unix libthread (i think that's where i saw it, although it might be well-known in fcntl land). a parent process needs to know whether a child has successfully done an exec of an arbitrary program (so it's hard to have that program tell the parent). the parent makes a pipe, marks the child's end as close-on-exec, forks, and then reads its end of the pipe. if the exec succeeds, the read returns 0; if the exec fails, the child writes the diagnostic on the pipe, so again the read returns something. --upas-eweyikyhtuylkuintquivjebvb Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Sun Mar 26 18:12:22 BST 2006 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 26B55F6CC for ; Sun, 26 Mar 2006 12:12:15 -0500 (EST) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id B8BDAEEDA for <9fans@cse.psu.edu>; Sun, 26 Mar 2006 12:11:46 -0500 (EST) Received: from mail.cse.psu.edu ([127.0.0.1]) by localhost (psuvax1 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18565-01-30 for <9fans@cse.psu.edu>; Sun, 26 Mar 2006 12:11:46 -0500 (EST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.239]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id DB8F4EEC8 for <9fans@cse.psu.edu>; Sun, 26 Mar 2006 12:11:45 -0500 (EST) Received: by wproxy.gmail.com with SMTP id i27so1164109wra for <9fans@cse.psu.edu>; Sun, 26 Mar 2006 09:11:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Gr4/0kKAQ05Mewg7BnClRuDDkUz9mD5ol2q6J5rffa2nuhIYHolENV/1g8zXXtFHQnfaYVzREi2ADMqnrB8bp8Y6bxfCv9kwg1UjBwuagHXdr/JzjZWsnoPWJh1T9FbeBhZx7/TWsIsE39HxJUvf3BkdPONZIWX+zNYLpaTG/GM= Received: by 10.54.143.4 with SMTP id q4mr1765855wrd; Sun, 26 Mar 2006 09:11:45 -0800 (PST) Received: by 10.54.92.11 with HTTP; Sun, 26 Mar 2006 09:11:45 -0800 (PST) Message-ID: <775b8d190603260911h73f5b3ceqb03c5724ab95f6fb@mail.gmail.com> Date: Mon, 27 Mar 2006 03:11:45 +1000 From: "Bruce Ellis" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] new system calls - semacquire, semrelease In-Reply-To: <8C5B5ACA-74AF-4CE4-B968-2AE392D8069B@orthanc.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <8C5B5ACA-74AF-4CE4-B968-2AE392D8069B@orthanc.ca> X-Virus-Scanned: by amavisd-new at cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu boyd would put keys in pipes so core dumps (incidental or nasty) wouldn't give them away. interesting to think about, given my current plumbing problems (water not bytes). brucee On 3/26/06, Lyndon Nerenberg wrote: > > On Mar 25, 2006, at 8:12 AM, Russ Cox wrote: > > > much like the old trick of storing a byte in a pipe > > and using it as an interprocess lock. > > It's a brilliant trick. It let us write some very portable code (to > windows, too, no less) with almost no effort. Don't knock > inginuity. (Or insanity. But that's just labels ...) > > --lyndon > --upas-eweyikyhtuylkuintquivjebvb--