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,9e7db243dfa070d7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Do people who use Ada also use ocaml or F#? Date: Sun, 31 Oct 2010 16:13:40 +0100 Message-ID: <87mxpuxumz.fsf@mid.deneb.enyo.de> References: <87ocab3mir.fsf@mid.deneb.enyo.de> <8j2nesF7crU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1288538020 3227 172.17.135.6 (31 Oct 2010 15:13:40 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:MCIwzFozYLpa+0WbmPXSMk206SQ= Xref: g2news2.google.com comp.lang.ada:16019 Date: 2010-10-31T16:13:40+01:00 List-Id: * Jeffrey Carter: > Yield does what is intended by > > delay 0.0; > > as it is currently used: create a scheduling point where another task > could get the processor, without otherwise slowing the current task > down if there is no such other task. > > Given that the trend is to multiprocessors, it seems an odd thing to > add at this point. As far as I understand it, there's some sort of industry-wide consensus to use coroutines/fibers/user-space cooperative threads to generate work items which are then dispatched to per-CPU worker threads. The challenge is to keep the workers busy, while not accumalting too much cruft which is only needed much later. The pmap example often used to promote Erlang shows this issue rather neatly, IMHO. In a sense, this challenge is a fallout from trying to solve the overscheduling problem (when you spawn more threads than you have resources, throughput decreases, often drastically). It is not an exact replica of the old N:M threading model because the coroutines are expected to be really lightweight this time. I guess it's still a waste of time because you need way too many processors to get even with a sequential approach where most of the overhead has been squeezed out. Except for tasks which can be partitioned with little or no communication, but those aren't in the interesting ones anyway because it's easy to split them into separate processes.