develooper Front page | perl.ithreads | Postings from March 2013

Re: Issues with process forking when 'multithreaded'.

Thread Previous | Thread Next
David Mertens
March 4, 2013 22:38
Re: Issues with process forking when 'multithreaded'.
Message ID:
No, no, I mean the module called "forks" from cpan:

Drop-in replacement for threads, including shared data handling. I but that
would solve your problem satisfactorily.


On Mon, Mar 4, 2013 at 10:31 AM, Sander Smeenk <> wrote:

> Quoting David Mertens (
> > Would it be possible to use the "forks" module? It is supposed to
> provide a
> > drop-in replacement for "threads" on operating systems that support posix
> > forks, which would be true in your case. I suspect this would cure your
> > problems, since everything would operate using forks instead of mixing
> > forks and threads.
> I "need" the threads because this brings me ':shared' scalars/hashes.
> I thought of doing this only with fork() but i'd need to create some
> kind of inter-process-communication thingie to get the results back,
> which isn't impossible, just requires me to rewrite a large part of
> my code. ;)
> And i still don't understand why mixing threads+fork is "not smart". ;)
> -Sndr.
> --
> | The short fortune teller who escaped from prison: a small medium at
> large.
> | 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2

 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About