indeed al this stuff can be one with channels but locks are
often easier, paryicularly if nested.
newlock: fn(): ref Lock;
lock: fn(l: ref Lock);
rlock: fn(l: ref Lock);
canlock: fn(l: ref Lock): int;
canrlock: fn(l: ref Lock): int;
unlock: fn(l: ref Lock);
brucee
On 3/25/06, Charles Forsyth <[EMAIL PROTECTED]> wrote:
> there is lock(2) in the public inferno distribution. the implementation is
> amusing.
> things like counting semaphores have been too, though not distributed,
> but these things are not used as much as channels in Limbo programming.
>
>
>
> ---------- Forwarded message ----------
> From: William Josephson <[EMAIL PROTECTED]>
> To: Fans of the OS Plan 9 from Bell Labs <[email protected]>
> Date: Fri, 24 Mar 2006 23:50:45 -0500
> Subject: Re: [9fans] new system calls - semacquire, semrelease
> On Fri, Mar 24, 2006 at 11:52:38AM +1100, Bruce Ellis wrote:
> > a bit like ...
> >
> > semnew: fn(n: int): ref Sem;
> > semacquire: fn(s: ref Sem);
> > semcanacq: fn(s: ref Sem): int;
> > semrelease: fn(s: ref Sem);
> >
> > in ozinferno
>
> Interesting... Say, is ozinferno available?
> Sounds like it might be interesting to poke at it.
>
>