From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 29 Oct 2010 09:14:05 -0500 Message-ID: From: Eric Van Hensbergen To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] A little more ado about async Tclunk Topicbox-Message-UUID: 71b4b84c-ead6-11e9-9d60-3106f5b1d025 On Fri, Oct 29, 2010 at 4:01 AM, Charles Forsyth wr= ote: >>What you are saying is that the problem could be something like: > >>-> Tclunk >>(do not wait for response) >>-> Topen (the file is exclusive) > > no, because what actually happens is closer to > =A0 =A0 =A0 =A0A: Topen > =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0queue request to *another process* to send Tclunk > =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0A: Topen > > leading to either case 1 > =A0 =A0 =A0 =A0A: Topen > =A0 =A0 =A0 =A0B: Tclunk > =A0 =A0 =A0 =A0A: Topen > > or case 2 > =A0 =A0 =A0 =A0A: Topen > =A0 =A0 =A0 =A0A: Topen > =A0 =A0 =A0 =A0B: Tclunk > > depending on the scheduling of the two processes A and B > > introducing that other process introduces a new race, that simply did not= exist before, because > that other process didn't exist before. you always got case 1. > > and indeed, with the test i ran on the modified system usually it gets ca= se 1 > because of timing, but eventually a case 2 shows up and the second open f= ails. > Just to make sure I understand things correctly, where does this mess things up with standard (as opposed to synthetic) file systems? ORCLOSE? OEXCL? Or is the primary concern the data flushing effect implicit in clunk? I'm inclined to agree with what I think gorka's stance is, send the clunk, but have an option to asynchronously gather the response (or make that the default and the option would be to synchronously wait for the response (waitfd(2)?) That would allow apps that really care about the data sync semantics (or oexcl, etc.) to make sure things have proceeded as planned, but wouldn't hold up the 99% of other apps that don't give a care. I guess my concern is that the always synchronous clunk for race-less semantics is simple, but if we really are giving up a big chunk of performance for the majority of uses and users, then it begs re-evaluation of the approach. -eric