comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Basic question about select
Date: Thu, 29 Apr 2010 10:27:12 -0700 (PDT)
Date: 2010-04-29T10:27:12-07:00	[thread overview]
Message-ID: <ee7c15df-2fbf-46d8-9e0b-7b8597ef3b17@y18g2000prn.googlegroups.com> (raw)
In-Reply-To: hrb2af$l4c$1@tornado.tornevall.net

On Apr 28, 9:25 pm, "Jeffrey R. Carter"
<spam.jrcarter....@spam.acm.org> wrote:
> Adam Beneschan wrote:
>
> > Is that necessarily the case?  Since there aren't any priorities
> > specified, I don't think it's defined whether the body of the main
> > procedure (assuming it's a procedure) starts running first, or the
> > body of PID (assuming a single processor).
>
> That's a big assumption, especially today. From pretty cheap systems on up,
> almost everything has at least 2 processors these days. Certainly that's the
> case for the system on which I tested it, and found that it deadlocks as
> originally written, but doesn't if "delay 1.0;" is added to the task before the
> accept.

Hmmm... I haven't studied the dispatching rules enough to know how
multiple processors affect things---that's why I assumed a single
processor, for simplicity.  If there are more than one, however, and
if the body of PID will get assigned to run on a different processor
than the main thread, then I'd think that makes things worse---you
can't tell at all whether the SELECT or the ACCEPT will occur first,
and there isn't any reason that it should work the same every time you
run it.  Again, I haven't thoroughly studied the new Ada 2005 language
dealing with dispatching, and I don't know what assumptions or
defaults GNAT uses, so perhaps there's some predictable reason why the
ACCEPT would occur first.

                           -- Adam






  reply	other threads:[~2010-04-29 17:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28 18:16 Basic question about select John Wilkinson
2010-04-28 18:36 ` Dmitry A. Kazakov
2010-04-28 21:00   ` Jeffrey R. Carter
2010-04-28 22:41     ` Dmitry A. Kazakov
2010-04-29  0:20       ` Jeffrey R. Carter
2010-04-29  2:16         ` Adam Beneschan
2010-04-29  4:25           ` Jeffrey R. Carter
2010-04-29 17:27             ` Adam Beneschan [this message]
2010-04-29 18:42               ` Jeffrey R. Carter
2010-04-29  0:47       ` Jeffrey R. Carter
2010-04-29  7:37         ` Dmitry A. Kazakov
replies disabled

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