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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af960bc705aaf51b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-02 16:59:12 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Complexity of protected objects Date: 2 Mar 2002 16:59:12 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0203021659.2998c4f7@posting.google.com> References: <3C7A75F2.30503@worldnet.att.net> <3c7e7c60.8192226@news.cis.dfn.de> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1015117152 25571 127.0.0.1 (3 Mar 2002 00:59:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Mar 2002 00:59:12 GMT Xref: archiver1.google.com comp.lang.ada:20705 Date: 2002-03-03T00:59:12+00:00 List-Id: Dale Stanbrough wrote in message news:... > Jim Rogers wrote: > Why is this? I see this as being a piece of programming > advice, - it's not a good idea to hold locks for a long > time - but is > there any more to it than that? Are there some other > consequences > of scheduling than that? It's amazing! The entire thread here is wandering off into irrelevance based on this pervasive notion that potentially blocking exactly matches the OS notion. I wish the RM had used the term "grubnoxious" instead of "potentially blocking" to avoid this confusion. Here's the deal. If you are using the approach to implementing PT's that completely avoids locks and depends on ceiling priority, then you really must avoid thread switches that could allow someone else to get into the eggshell. But if you are in fact using locks, there is no reason at all to be worried about context switches. Yes, of course the programmer will have to avoid deadlock in this case, just as they would have to with tasks, but that's a different level of concern entirely. In fact GNAT works perfectly fine, as expected, if you do blocking operations within PT's