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

Re: Issues with process forking when 'multithreaded'.

Thread Previous | Thread Next
From:
Sander Smeenk
Date:
March 4, 2013 16:32
Subject:
Re: Issues with process forking when 'multithreaded'.
Message ID:
20130304163158.GC9656@dot.freshdot.net
Quoting David Mertens (dcmertens.perl@gmail.com):

> 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About