From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4fdbe45db39b4c9d8bb6f360e12dde9c@brasstown.quanstro.net> References: <4fdbe45db39b4c9d8bb6f360e12dde9c@brasstown.quanstro.net> Date: Tue, 31 Aug 2010 07:59:35 -0700 Message-ID: From: ron minnich 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] problem with building from source on vx32 solved Topicbox-Message-UUID: 4bbc3bf6-ead6-11e9-9d60-3106f5b1d025 On Tue, Aug 31, 2010 at 5:54 AM, erik quanstrom wro= te: >> A simple change: >> pid =3D getpid(); > > shouldn't you just fix it so _tos->pid is set? yep. I just have to find the time. > > also, the comments in the new nsec.c don't > match the code. =A0the code looks something like this > > =A0 =A0 =A0 =A0do{ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tries =3D 0; > =A0 =A0 =A0 =A0}while(tries++ =3D=3D 0); =A0 /* retry once */ > > of course either this should be > > =A0 =A0 =A0 =A0/* just retry for ever */ > =A0 =A0 =A0 =A0for(;;){ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0} > or > =A0 =A0 =A0 =A0/* retry once */ > =A0 =A0 =A0 =A0for(tries =3D 0; tries < 2; tries++) > > also, there's nothing stoping the race between > - two procs allocating the same element of the pid array > - two procs opening the global fd twice personal opinion: the difficulty of getting this code right, and its complexity, tell me something is wrong with the interface. Look at the trouble we're going through to get a 64-bit number out of the kernel. Look at how hard it is to get right. Two ways out: 1. "reserved" fds. an fd that is always open, can not be closed, and will return important values, e.g. reserved fd 32766 could always be a connection to bintime 2. a system call to get bintime. others? Either way I don't see the current approach as making a lot of sens= e. ron