| |||||||||||
| |||||||||||
Forking a Perl Process, and pipe
![]()
If you want a Perl process to perform two tasks in parallel, you can use threads or forks, and forks are
the recommended way at present as thread support is a bit too flaky. When you fork a process, you're left
with a parent and a child process, with each of them designed to perform a task. In order for these
two proceses to co-operate once they've been split off, you can open a pipe prior to forking, and that
gives you a two way channel using file handles for later communication. If either of the resulting
processes needs to contact the other asyncronously, it can use a signal - a subject that we can also
cover on our Perl courses.
Show a large image More about forks, pipes and signals Associated topic - Perl - Interprocess Communication |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||