Net::FTP and forks, Win32
Posted by darrenward (darrenward), 18 July 2006Hello All,
I'm having a problem with Net::FTP and Parallel::ForkManager. What I am trying to do is download multiple files from an FTP server simultaneously, using forks. The forks are handled by Parallel::ForkManager.
When I run my code it downloads the files but gives a Windows error, perl.exe memory could not be "written"\memory could not be "read". It would appear that the Net::FTP objects are being destroyed before the file has finished downloading\fork completed, and so this error is being produced. I have tried adding more tasks to the fork so that it would complete them after the get and then call the fork finish but it doesn't make any difference. It does not appear to be a Parallel::ForkManager problem as I could not get normal forking to work either, same error messages.
It's probably something really simple, or it is just not possible to use forks with Net::FTP on Win32.
Does anyone have any ideas, any help would be much appreciated?
Part of my test.pl
I have made another module, which uses Parallel::ForkManager, which this passes callbacks to.
ForkManager.pm --> This is the one I created
Posted by admin (Graham Ellis), 19 July 2006Only 2 out of about 30 CPAN test results reported for Parallel::ForkManager is for a Windows based system ... the remainder are for *nix operating systems.
As I understand it, forking is one of those areas that's very much different in how it can be done between *nix and *dose, so perhaps there's issues there. But I do also wonder about my variables going out of scope in the parallel processing context, and I would suggest as a next stage writing a very simple test case to fork out two parallel processes without using transient variables and seeing if the problem persists.
P.S. Any way you can test your code out on a Unix / Linux box?
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho