comp.lang.ada
 help / color / mirror / Atom feed
From: "Chris Sparks (Mr. Ada)" <sparks@NFS.AISF.COM>
Subject: Re: Recursive Protected types getting deadlocked!
Date: 1997/09/09
Date: 1997-09-09T00:00:00+00:00	[thread overview]
Message-ID: <341560D3.711A@aisf.com> (raw)
In-Reply-To: 199709090355.UAA29772@wanchai.aisf.com


Tucker Taft wrote:

> > Dale Stanbrough (dale@goanna.cs.rmit.EDU.AU) wrote:
> >
> > : I've written a small semaphore that records the task id of the owner,
> > : allowing recusive lock taking (i'm looking at how Java tasking works).
> >
> > : The following code seems to deadlock however. It seems that when a
> > : 2nd task is woken up on the Queued entry, it does so in the context
> > : of the first Task (or so the Image function tells me...).
> >
> > : This to me seems very strange. Is it likely to be an error in Gnat,
> > : or is it a misunderstanding on my part as to how this all works...
> >
> Any "convenient" thread may perform an entry body (RM95 9.5.3(22)).
> This flexibility can be critical to minimizing unnecessary context
> switches and lock transfers.  Hence, asking for "Current_Task" from
> inside an entry body is not useful.  If you need to get the
> identity of the thread which initiated an entry call, use
> the 'Caller attribute (C.7.1(14)).
>
> For example, inside Seize you should use "Seize'Caller"
> rather than "Current_Task"; inside Release you should use
> "Release'Caller".

Release is a procedure not an entry.  Maybe you meant the entry "Queue".

Chris Sparks




           reply	other threads:[~1997-09-09  0:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <199709090355.UAA29772@wanchai.aisf.com>]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox