Summary


 
Network Programming with Perl
By Lincoln  D.  Stein
Slots : 1
Table of Contents
Chapter  12.   Multiplexed Applications

    Content

This chapter completes our survey of all three of the major techniques for handling concurrent stream-oriented connections. Each has advantages and disadvantages.

Multitasking using fork() is currently available only on UNIX and Win32 platforms (using Perl 5.6 or higher). It has more overhead than the other methods due to the necessity of launching a new process to deal with each connection, but programs written using the technique tend to be simple and reliable.

Multithreading is available on Win32 and many UNIX platforms and requires a version of Perl that is built with threading support. Threaded applications must be careful to lock and release shared variables and other resources, adding to the complexity of the code. We were able to get away without using locking in the examples so far, but most real network applications have to deal with this issue. Unfortunately, threading is not stable in current versions of Perl, and its API is likely to change.

Multiplexing is available on all platforms on which Perl runs, including the Macintosh. Its drawback is that it makes the program logic more difficult to follow due to the necessity of interleaving the I/O from multiple sessions. Furthermore, it isn't bulletproof unless combined with nonblocking I/O, which adds significant complexity to the code.


   
Top


Network Programming with Perl
Network Programming with Perl
ISBN: 0201615711
EAN: 2147483647
Year: 2000
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net