I have a project must send a lot of file in win2k at the same time.
But what is the best method in win32?
Can the perl build-in function fork work in win32?
Or the perl build-in thread is good solution
Besides Anno's answer, be aware that threads have severe limitations. More
to the point, threads and signals don't mix. So if you need timeouts (in
Perl) or any other signal handling, you are pretty much stuck on forking.
Other than that, in general threads are faster than forks. New threads are
created faster and interthread/process communication is generally faster.
However on Windows, forks are implemented as threads (according to Anno)
so the equation may be different on Windows.
Now you say that this is about "a lot of file". Do you mean transfers of
big files? In that case the transfer time is likely to swamp any
difference between threads and forks, as long as the threads/processes
don't need to communicate much.
The best answer may be to try it out.
HTH,
M4