Y
Yash
I have a perl program that spawns as many threads as the number of
processors. Each thread reads lines from a set of files exclusively
assigned to it and after performing some in-memory operations, writes
the enriched lines back to disk.
The number of threads is limited by the number of files to process.
When I ran with a single file, it spawned just one thread and took 200
seconds to finish. I could see 1 CPU occupied by looking at the Task
Manager.
When I made 4 copies of the file, it spawned 4 threads and too 800
secs. I was expecting it to take a little more than 200 secs. All 4
CPUs were seen to be occupied.
There is no locking or synchronization between the threads.
This means that the program does not scale up as expected, by
processing more data in different threads.
Is there something else I might need to do in the program logic so
that adding more processors will help me process larger volumes of
data in the same time?
I am using Active Perl 5.8 on Windows 2000.
Thanks
processors. Each thread reads lines from a set of files exclusively
assigned to it and after performing some in-memory operations, writes
the enriched lines back to disk.
The number of threads is limited by the number of files to process.
When I ran with a single file, it spawned just one thread and took 200
seconds to finish. I could see 1 CPU occupied by looking at the Task
Manager.
When I made 4 copies of the file, it spawned 4 threads and too 800
secs. I was expecting it to take a little more than 200 secs. All 4
CPUs were seen to be occupied.
There is no locking or synchronization between the threads.
This means that the program does not scale up as expected, by
processing more data in different threads.
Is there something else I might need to do in the program logic so
that adding more processors will help me process larger volumes of
data in the same time?
I am using Active Perl 5.8 on Windows 2000.
Thanks