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

Re: Issues with process forking when 'multithreaded'.

Thread Previous | Thread Next
From:
David Mertens
Date:
March 4, 2013 22:38
Subject:
Re: Issues with process forking when 'multithreaded'.
Message ID:
CA+4ieYUkfGT7fNYF9hmFZ_ijcmYeRWLmRYcVYSZ0AH8v7kBoaA@mail.gmail.com
No, no, I mean the module called "forks" from cpan:
https://metacpan.org/module/forks#same-API-as-threads

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

David


On Mon, Mar 4, 2013 at 10:31 AM, Sander Smeenk <ssmeenk@freshdot.net> wrote:

> 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
>



-- 
 "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


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