caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Nproc: process pools for OCaml (request for suggestions)
@ 2011-11-30  2:54 Martin Jambon
  2011-11-30  9:35 ` Jerome Vouillon
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Jambon @ 2011-11-30  2:54 UTC (permalink / raw)
  To: OCaml Mailing List

I would like to publicize Nproc, which is an implementation of process
pools for OCaml based on fork, pipes, Marshal and Lwt:

  https://github.com/MyLifeLabs/nproc

Using Nproc involves:

1. Creating a pool of N processes, N being chosen by the user.
2. Running tasks:
  a. Submitting a task (f, x) of any type.
  b. Defining what to do when the result becomes available.

Possible uses of Nproc include:

- running CPU-intensive tasks on multiple cores
- detaching synchronous operations for which a non-blocking version is
not available


Let me know of your comments, suggestions, questions, etc.


Martin

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

* Re: [Caml-list] Nproc: process pools for OCaml (request for suggestions)
  2011-11-30  2:54 [Caml-list] Nproc: process pools for OCaml (request for suggestions) Martin Jambon
@ 2011-11-30  9:35 ` Jerome Vouillon
  2011-11-30 21:32   ` Martin Jambon
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Vouillon @ 2011-11-30  9:35 UTC (permalink / raw)
  To: Martin Jambon; +Cc: OCaml Mailing List

Hi,

On Tue, Nov 29, 2011 at 06:54:46PM -0800, Martin Jambon wrote:
> I would like to publicize Nproc, which is an implementation of process
> pools for OCaml based on fork, pipes, Marshal and Lwt:
> 
>   https://github.com/MyLifeLabs/nproc
> 
> Using Nproc involves:
> 
> 1. Creating a pool of N processes, N being chosen by the user.
> 2. Running tasks:
>   a. Submitting a task (f, x) of any type.
>   b. Defining what to do when the result becomes available.

Marco Danelutto and Roberto Di Cosmo have written a small library to
perform parallel maps and folds on multi-core machines. This is
complementary to your library. You should look at the implementation:
communication is performed by marshalling to a shared memory area for
better performances, and pipes are used only for synchronization.

     https://gitorious.org/parmap/


I have also written a more low-level library, where you can control
which process runs each task. This is useful when the processes have
to work with a lot of data that you don't want to duplicate. You can
get the code with the following command:

     darcs clone http://www.pps.jussieu.fr/~vouillon/coinst/darcs/dev/

The file of interest is task.ml.

-- Jerome

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

* Re: [Caml-list] Nproc: process pools for OCaml (request for suggestions)
  2011-11-30  9:35 ` Jerome Vouillon
@ 2011-11-30 21:32   ` Martin Jambon
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Jambon @ 2011-11-30 21:32 UTC (permalink / raw)
  To: Jerome Vouillon; +Cc: OCaml Mailing List

On 11/30/2011 01:35 AM, Jerome Vouillon wrote:
> Hi,
> 
> On Tue, Nov 29, 2011 at 06:54:46PM -0800, Martin Jambon wrote:
>> I would like to publicize Nproc, which is an implementation of process
>> pools for OCaml based on fork, pipes, Marshal and Lwt:
>>
>>   https://github.com/MyLifeLabs/nproc
>>
>> Using Nproc involves:
>>
>> 1. Creating a pool of N processes, N being chosen by the user.
>> 2. Running tasks:
>>   a. Submitting a task (f, x) of any type.
>>   b. Defining what to do when the result becomes available.
> 
> Marco Danelutto and Roberto Di Cosmo have written a small library to
> perform parallel maps and folds on multi-core machines. This is
> complementary to your library. You should look at the implementation:
> communication is performed by marshalling to a shared memory area for
> better performances, and pipes are used only for synchronization.
>
>      https://gitorious.org/parmap/
>
>

Thank you, this is interesting. I hadn't look at the implementation
although I knew about parmap but wanted something with an Lwt-ready
interface. I also wanted something that could handle continuous streams,
without having to create a process for each stream item (assuming fork()
is more expensive than we want).


> I have also written a more low-level library, where you can control
> which process runs each task. This is useful when the processes have
> to work with a lot of data that you don't want to duplicate. You can
> get the code with the following command:
> 
>      darcs clone http://www.pps.jussieu.fr/~vouillon/coinst/darcs/dev/
> 
> The file of interest is task.ml.

I see. Thanks.


Martin

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

end of thread, other threads:[~2011-11-30 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-30  2:54 [Caml-list] Nproc: process pools for OCaml (request for suggestions) Martin Jambon
2011-11-30  9:35 ` Jerome Vouillon
2011-11-30 21:32   ` Martin Jambon

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 NNTP newsgroup(s).