[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: save/load with pipes
From: |
Daniel Kraft |
Subject: |
Re: save/load with pipes |
Date: |
Mon, 03 Mar 2014 12:40:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Hi!
On 2014-03-03 11:36, Olaf Till wrote:
> On Mon, Mar 03, 2014 at 10:00:15AM +0100, Daniel Kraft wrote:
>> In one of my codes, I'm using fork to split processing of my data set
>> onto multiple processes. The subprocesses send their results back via
>> temporary files and the save/load mechanism for simplicity. It would be
>> much cleaner to use pipes instead. But since the pipe() function
>> returns a pair of file descriptors, I wonder whether one can use
>> save/load (or a similar high-level function which serialises the data
>> for me) also with file descriptors and not just with file names. Is
>> there a way to do that?
>
> Yes, in the current version of the 'parallel' package there are two
> different pairs of functions which do that. Only one variable is
> transfered at a time.
>
> fsave/fload have less overhead and are meant for communication within
> the local machine. You should probably use these.
Ah great, that's exactly what I was looking for! Thanks!
Yours,
Daniel
--
http://www.domob.eu/
OpenPGP: 901C 5216 0537 1D2A F071 5A0E 4D94 6EED 04F7 CF52
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done: Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri