in reply to How to multiprocess in Win32?

What crashes? I thought fork emulation works pretty well for Perl stuff.

As for alternatives: a few years ago, I wrote a protocol monitor by implementing the multithreaded queued read/write part in C++, but embedded a Perl interpreter for processing the data being "tapped". You can embed perl.dll and run interpreters on several threads.

Replies are listed 'Best First'.
Re: Re: How to multiprocess in Win32?
by Rex(Wrecks) (Curate) on Aug 30, 2001 at 20:36 UTC
    The most prevalent is "The instruction at 0xblah reference memory at 0xbleech. The memory could not be "read"

    Strange thing is that it is not a consistant crash. I can run a program that does this 2-3 times without a crash, and then 2-3 times with the crash.

    UPDATE: The other thing I should mention is that all proggies that do this to me execute flawlessly under FreeBSD.

    Rex(Wrecks) wishes he could be in league with the little red devil always
      So a program that uses ActiveState's fork() is giving stray pointer crashes when run, sometimes?

      Any machine-level stray pointer in a pure Perl (no XS, no API calls) program is by definition a Perl bug.

      In a compiled language, a debugger easily spots the instruction doing that and lets you view the stack to see what it was up to. I don't know how you'd do it in Perl. A general-purpose mechanism would be to "confess" the stack trace any time a machine-level exception or signal is encountered. I have no idea how to set things up to do that, but I think it ought to be built-in.

      —John

        I've never had any difficulty getting Perl to crash when using the emulated fork under Win32. Even trivial programs will crash or just plain "act strange". It is so easy to get it to fail that I haven't even bothered filing a bug report (just picking which of dozens to send in first would be a problem).

        As for multiprocessing, I've mostly replaced fork with:

        if( @ARGV && $ARGV[0] eq "-child" ) { shift( @ARGV ); # child code here exit( 0 ); } # Am parent # ... system(1,$^X,$0,"-child",@ARGV); # run child # ...
        in cases when I needed it.

                - tye (but my friends call me "Tye")