> On Jul 6, 2015, at 9:43 AM, Unknown User <knowsuperunkn...@gmail.com> wrote:
> 
> What is a good way to fire and forget a sub from a module in perl, in a non 
> blocking mode, preferably without forking or using threads.
> I may have to run the sub a few times to determine the approx delay for it to 
> run, so i suppose i need a blocking mode for it too. But afterwards, it can 
> run in non blocking mode.
> 
> - Unknown

There is no way to call a subroutine and have it return immediately yet still 
do productive work in the background without using some sort of multi-tasking, 
i.e., forks or threads, on a single, normal computer.

Starting a separate process using fork is relatively easy. The problem is 
figuring out when the forked process is done and getting information back from 
it to the main program.

See ‘perldoc perlipc’ for ideas on creating and communicating with separate 
processes.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to