unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Parallel Guile code called from parallel C code
@ 2011-08-10 15:49 pablo
  2011-08-21  9:22 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: pablo @ 2011-08-10 15:49 UTC (permalink / raw)
  To: guile-devel

Hello everyone,
I have a question about calling parallel Guile functions from a
parallel C program.

Suppose the situation is such that there is a parallel C program and
two threads which call Guile functions and that these Guile functions
use future to go parallel.

The Guile doc says "Internally, a fixed-size pool of threads is used
to evaluate futures, (...) the pool contains one thread per available
CPU core, minus one, to account for the main thread."

Then how does this work in the situation I described? Do the two
concurrent parallel Guile functions use threads from the same pool or
is there actually two pool? (ie. does each C threads calling a Guile
function have an independent Guile environment regarding the possible
parallelization of the Guile function itself?)


I'm not sure my question is very clear, sorry if it's not the case :-S.

Thanks!

--
Pablo.
http://pablo.rauzy.name/



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Parallel Guile code called from parallel C code
  2011-08-10 15:49 Parallel Guile code called from parallel C code pablo
@ 2011-08-21  9:22 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2011-08-21  9:22 UTC (permalink / raw)
  To: guile-devel

Hi,

pablo <r@uzy.me> skribis:

> The Guile doc says "Internally, a fixed-size pool of threads is used
> to evaluate futures, (...) the pool contains one thread per available
> CPU core, minus one, to account for the main thread."
>
> Then how does this work in the situation I described? Do the two
> concurrent parallel Guile functions use threads from the same pool or
> is there actually two pool? (ie. does each C threads calling a Guile
> function have an independent Guile environment regarding the possible
> parallelization of the Guile function itself?)

There’s a single thread pool per Guile instance.  See ice-9/futures.scm:
there’s a global variable holding a list of threads, basically.

HTH,
Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-21  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-10 15:49 Parallel Guile code called from parallel C code pablo
2011-08-21  9:22 ` Ludovic Courtès

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).