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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,115bda8caeda5fa4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.23.39 with SMTP id j7mr920481pbf.30.1315911438270; Tue, 13 Sep 2011 03:57:18 -0700 (PDT) Path: m9ni5319pbd.0!nntp.google.com!news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 13 Sep 2011 05:57:15 -0500 Date: Tue, 13 Sep 2011 06:57:05 -0400 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Does GNAT support a thread-free RTS? References: In-Reply-To: Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-D6TCpE5C2MK62r4x6v37WTPSH+XCog7kbfk2toMUZvGfIFwQYp6uCzaPlQTqBhgor5h9UtmEV5RIaxF!WjB+dpQaxFiCs+tTzsbK9H7ZZqMLdFoJpQoM8IfQymEnsGVRT+/h6aUoebZZzEE= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2305 Xref: news1.google.com comp.lang.ada:17941 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-09-13T06:57:05-04:00 List-Id: On 2011-09-13 04:30, Simon Wright wrote: > Simon Wright writes: > > My prompt for asking this was a colleague who was used to Erlang and was > complaining that GNAT's use of OS threads meant he would have to change > his design mindset to not use thousands of tasks (Erlang processes). If one is in control of the run time library and if the underlying OS supports asynchronous I/O, then I believe it is possible to write a user mode thread library that works "nicely" even in the face of I/O operations. When calling an I/O operation that might block the library uses asynchronous I/O so that the single kernel thread can be scheduled onto a different user thread while the I/O completes. > I believe Scala is similar. In Scala you can create "thread based" actors that consume a single thread each or "event based" actors that can all share a single thread. I haven't experimented with this but my guess is that if you do a blocking operation while handling an event you may well tie up all event based actors. I imagine the thread based actors would continue to work, however. Peter