Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

renodino's scratchpad

by renodino (Curate)
on Jan 24, 2006 at 00:54 UTC ( #525088=scratchpad: print w/replies, xml ) Need Help??

for BrowserUk

I gave it a whirl on WinXP SP2, 2.4GHz, 1 Gig. But I used /stack:1024,0, and modified the code:

use strict; use threads; use threads::shared; use Win32::Console; our $N = 500; our $alldone : shared = 0; sub thread { my( $con, $n) = @_; my $tid = threads->self->tid; my( $y, $x ) = ( ( $tid % 20 ) * 5, int( $tid / 20 ) ); { lock $alldone; $alldone++; } $con->WriteChar( sprintf( '%04d', $_ ), $y, $x ) for 1 .. 3999; } $N = ($ARGV[0]=~/^-N=(\d+)/) ? $1 : 500; my $con = Win32::Console->new( STD_OUTPUT_HANDLE ); $con->Cls; my @threads = (); { lock $alldone; foreach (1.. $N) { push @threads, threads->new( \&thread, $con, 0 ) or die "threads->new failed with: $^E"; print "$_\r"; } print "\n"; } $_->join for @threads;
and squeezed out 1500 (could've gone higher, still had a Gig of pagefile left, but the laptop fan was screaming from the heat!). I'll try on my dual Xeon box this weekend; and also on a major threaded app I've got that uses the threading modules I've been working on.

So does this mean the issue is actually the default stack size, rather than the TLS ? And if so, might tweaking /HEAP have a similar effect ?

Log In?

What's my password?
Create A New User
[pryrt]: Is there a way to search for/list "nodes I've voted on"? (I thought there was, but cannot find it now)
[choroba]: Your votes in your profile?
[ambrus]: pryrt: yes, there is. link "Your votes" from your profile page.
[ambrus]: (That link work two ways: from your own profile page, it lists all your votes; from anyone else's profile page, it lists your votes on that user's nodes only.)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-03-29 13:36 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (351 votes). Check out past polls.