From: Mark H Weaver <mhw@netris.org>
To: ludo@gnu.org (Ludovic Courtès)
Cc: Nala Ginrut <nalaginrut@gmail.com>,
guile-devel@gnu.org, 13188-done@debbugs.gnu.org
Subject: bug#13188: Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow)
Date: Thu, 28 Mar 2013 14:00:52 -0400 [thread overview]
Message-ID: <87ip4b9zfv.fsf__5870.66149241782$1364493728$gmane$org@tines.lan> (raw)
In-Reply-To: <87r4izprks.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 28 Mar 2013 14:44:03 +0100")
Hi Ludovic,
ludo@gnu.org (Ludovic Courtès) writes:
> Mark H Weaver <mhw@netris.org> skribis:
>
>> It only makes sense to use 'par-map' when the procedure is fairly
>> expensive to compute.
>
> Indeed.
>
>> There is inevitably a lot of overhead in creating and joining the
>> threads.
>
> We use a thread pool, so there’s no such cost.
Sorry, I was using the term 'threads' not in the sense of OS-level
threads, but in a more general sense. I should have been more clear.
What I meant is that from the user's perspective, threads are being
created and joined, and even if you build those using a pool of OS-level
threads, this inevitably involves thread synchronization, which is very
expensive on modern architectures. So I maintain that there _is_ such a
cost, and it can't be avoided.
The point I was really trying to make here, in the simplest possible
terms, is that it will *never* make sense to replace all uses of 'map'
with 'par-map' wherever it is safe to do so.
> But there are other costs. When delimited continuations are used, we’re
> on the slow path. Also, Guile’s fat mutexes & co. are terribly
> inefficient. And finally, there may be contention on the futexes mutex
> (esp. when the computations is too small.)
Indeed, I wouldn't be surprised if we could improve this by an order of
magnitude. More items for my TODO list :)
> So yes, there’s room for improvement. Yet, it should be fruitful,
> provided you use it for reasonably long computations, as Mark outlines.
Regards,
Mark
next prev parent reply other threads:[~2013-03-28 18:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 8:12 bug#13188: par-map causes VM stack overflow Nala Ginrut
2013-03-27 17:12 ` Ludovic Courtès
2013-03-28 2:55 ` bug#13188: Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Nala Ginrut
[not found] ` <1364439334.2730.41.camel@Renee-desktop.suse>
2013-03-28 5:05 ` Mark H Weaver
[not found] ` <874nfwazc3.fsf@tines.lan>
2013-03-28 13:44 ` Ludovic Courtès
[not found] ` <87r4izprks.fsf@gnu.org>
2013-03-28 18:00 ` Mark H Weaver [this message]
[not found] ` <87ip4b9zfv.fsf@tines.lan>
2013-03-28 20:07 ` Ludovic Courtès
2013-03-29 2:36 ` Nala Ginrut
[not found] ` <1364524610.2730.48.camel@Renee-desktop.suse>
2013-03-29 9:52 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87ip4b9zfv.fsf__5870.66149241782$1364493728$gmane$org@tines.lan' \
--to=mhw@netris.org \
--cc=13188-done@debbugs.gnu.org \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=nalaginrut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).