segmentation fault / threads

Discussion in 'Perl Misc' started by Stuart Kendrick, Aug 26, 2004.

  1. has anyone developed any tricks for spawning lots of threads?

    i'm using perl 5.8.5, making use of threads ... i'd like to spawn
    several hundred at a time (i've written them to go off and perform
    tasks which take a long time ... like perform nessus scans of every
    active IP address on a subnet ... )

    more often than not, the master thread crumps with a Segmentation
    Fault, after spawning ... a few dozen. rather unpredictable, actually
    -- sometimes, the whole routine succeeds, spawning several hundred
    threads and running them just fine. sometimes, it crumps after
    spawning a few ... sometimes after spawning a few dozen ... i don't
    see a rhythym yet to the behavior.

    i've found that inserting a delay ("sleep 10;" for example) between
    spawning events generally increases the number of threads i can launch
    before the Segementation Fault occurs. has anyone developed any other
    tricks? i realize that threading is new in Perl ... but i find it so
    useful, that i'm using it already, despite this wart, in a variety of
    applications.

    #!/usr/bin/perl
    use strict;
    use warnings;
    use threads;
    use threads::shared;
    use Thread::Running qw(running);
    [...]

    --sk

    stuart kendrick
    fhcrc
     
    Stuart Kendrick, Aug 26, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley
    Replies:
    17
    Views:
    868
  2. Pud
    Replies:
    0
    Views:
    578
  3. Replies:
    0
    Views:
    530
  4. Lucas Nussbaum
    Replies:
    12
    Views:
    304
    Tanaka Akira
    Jul 23, 2005
  5. kath
    Replies:
    6
    Views:
    280
Loading...

Share This Page