Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: One piece of code, two mysteries!

by Polyglot (Chaplain)
on Oct 05, 2012 at 03:52 UTC ( [id://997369]=note: print w/replies, xml ) Need Help??


in reply to Re^2: One piece of code, two mysteries!
in thread One piece of code, two mysteries! (UPDATED.)

Ok, when I set it to 16k (16384), I got a segmentation fault. When I commented out the line entirely, it seemed to go to indefinite sleep and returned nothing to the screen. I did not even see the process in "top." I finally tried setting the stack to 65535 and got the following output.
# ./test_perl.pl 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Is that what was expected?

Blessings,

~Polyglot~

Replies are listed 'Best First'.
Re^4: One piece of code, two mysteries!
by BrowserUk (Patriarch) on Oct 05, 2012 at 04:09 UTC
    When I commented out the line entirely,

    Do you mean like this?:

    #use threads stack_size => 4096;

    If so, you should have at the very minimum got an error: "Can't call method "async" without a package or object reference at ..."!?

    To disable the stack_size parameter, you should do:

    use threads; # stack_size => 4096;

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      That's interesting. Yes, I commented out the entire line, but got no error message. It was simply as if the program had hung. I had to CTRL + C out of it after I had waited a couple minutes or so. (Tried again later and it went over 12 min. before I lost patience.)

      Just for fun, I just ran it with the "use threads;" implementation, and it gave me the exact same results as with the 64k stack size.

      Blessings,

      ~Polyglot~

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997369]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-19 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found