After updating the site configuration to
<Location /testSharing> Options -MultiViews SetHandler perl-script PerlResponseHandler U2D::TestSharing </Location>
because apparently MultiViews doesn't work well with the code for updating the logfile.
I'm getting the following output when holding down F5 a few seconds in my browser:
02-08-2011 13:09:40:037 9209-4216514368: Waiting for lock. 02-08-2011 13:09:40:045 9209-4216514368: Acquired lock. 02-08-2011 13:09:40:045 9209-4216514368: Initializing fruits. 02-08-2011 13:09:40:045 9209-4216514368: Releasing lock. 02-08-2011 13:09:40:045 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:40:443 9209-4216514368: Waiting for lock. 02-08-2011 13:09:40:443 9209-4216514368: Acquired lock. 02-08-2011 13:09:40:443 9209-4216514368: Releasing lock. 02-08-2011 13:09:40:443 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:40:941 9209-4216514368: Waiting for lock. 02-08-2011 13:09:40:941 9209-4216514368: Acquired lock. 02-08-2011 13:09:40:942 9209-4216514368: Releasing lock. 02-08-2011 13:09:40:942 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:000 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:001 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:001 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:001 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:014 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:014 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:014 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:014 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:062 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:063 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:063 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:063 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:090 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:090 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:090 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:090 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:119 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:119 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:119 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:120 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:146 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:146 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:146 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:146 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:191 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:192 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:192 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:192 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:222 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:222 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:222 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:222 9209-4216514368: I like to eat apple, banana, +peach. 02-08-2011 13:09:41:253 9209-4216514368: Waiting for lock. 02-08-2011 13:09:41:253 9209-4216514368: Acquired lock. 02-08-2011 13:09:41:253 9209-4216514368: Releasing lock. 02-08-2011 13:09:41:253 9209-4216514368: I like to eat apple, banana, +peach.
That looks reasonably like the result you wanted, so I wonder what's happening on your end that makes things different.
Oh, and I changed your logTestMessage a bit, since / is not a writable location for apache (hence the 'permission denied's I was getting).
sub logTestMessage { my $message = shift; my $tid = APR::OS::current_thread_id(); if(open(FILE,'>>','/var/www/testSharing.log')) { print FILE $time{'dd-mm-yyyy hh:mm:ss:mmm'}.' '.$$.'-'.$tid.': + '.$message."\n"; close(FILE); } else { print "Error opening file: ".$!."\n"; } }

In reply to Re: Threaded MPM Sharing Variables (this time with complete test code) by Neighbour
in thread Threaded MPM Sharing Variables (this time with complete test code) by busymeister

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.