in reply to Scheduling Perl Tasks

File locking is hard to do right but possible, and can be used to ensure your process doesn't collide with another instance of itself.

There will certainly be caveats under Windows, some of which might be enumerated in perlport.


Dave

Replies are listed 'Best First'.
Re^2: Scheduling Perl Tasks
by Anonymous Monk on Mar 23, 2017 at 06:43 UTC
    I think there is some lock modules on cpan that simplify/abstract the complexity
Re^2: Scheduling Perl Tasks
by 9mohit2 (Sexton) on Mar 23, 2017 at 10:43 UTC
    Hi Dave,

    What if I can manage that same script does not runs in parallel will perl scritps accessing separate excel files can also cause any issue?? I also used Win32::OLE module for many scripts.

      So you now are ok with the same script running as long as it's acting on different files? Then yes, that's just fine. Use flock, as discussed in the slides I linked to, to lock the files you are acting upon. That will ensure that multiple instances of your script cannot possibly touch the same file. If you do that, sure, there's nothing wrong with running the same script multiple times simultaneously against different data sets, so long as none of the instances attempt to write to the same file.


      Dave