From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,25642dc8f94534f6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!y18g2000prn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Basic question about select Date: Thu, 29 Apr 2010 10:27:12 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1p2m3s7y70lsa$.79fl3we9edva$.dlg@40tude.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1272562033 12910 127.0.0.1 (29 Apr 2010 17:27:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 29 Apr 2010 17:27:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y18g2000prn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11255 Date: 2010-04-29T10:27:12-07:00 List-Id: On Apr 28, 9:25=A0pm, "Jeffrey R. Carter" wrote: > Adam Beneschan wrote: > > > Is that necessarily the case? =A0Since 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 u= p, > 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 befo= re 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