in reply to Threads and print

By correcting your calculation of $N.
$N = $to/5;
However, you still have an issue because the records overlap. Didn't we discuss this before here 755631? I suggest you use a single thread to write to the log file, rather than trying to get all the threads to write at the same time.

Replies are listed 'Best First'.
Re^2: Threads and print
by sandy1028 (Sexton) on Apr 16, 2009 at 08:39 UTC
    Can you please tell me some tutorial regarding it. Like how to create a single log file for each thread. It the $to value is increased also only 5 threads should be created.
      The above code works fine with commenting lock $$semRef; Can anyone please explain me what is the use of locking method in the above code.