[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
save/load with pipes
From: |
Daniel Kraft |
Subject: |
save/load with pipes |
Date: |
Mon, 03 Mar 2014 10:00:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Hi!
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?
(My code is basically a custom implementation of parcellfun, so maybe
I'll switch to parcellfun in the future anyway. But I still believe
this is something interesting to know in case I need a communication
tool like this in the future for something else.)
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
- save/load with pipes,
Daniel Kraft <=