x
Loading
 Loading
Hello, Guest | Login | Register

Doing Many Things at Once

Since the first version of Unix back some three decades ago, the fork() system call has been the normal way to get many things to happen at once. Forking is a very nice (some say “elegant”) model of concurrent execution: individual processes have entirely separate address spaces, with little chance of interference from other tasks, at the cost of a lot of overhead for interprocess communication.

Since the first version of Unix back some three decades ago, the fork() system call has been the normal way to get many things to happen at once. Forking is a very nice (some say “elegant”) model of concurrent execution: individual processes have entirely separate address spaces, with little chance of interference from other tasks, at the cost of a lot of overhead for interprocess communication.

Starting some dozen years ago, user-space thread libraries have popped up. Threads can simplify inter-task communication, but can also make it easier for threads to stomp on each other’s data and control flow. The Perl developers have taken different stabs at incorporating interfaces to thread libraries, with some relative success.

But even while that was going on, there were also independent efforts by the Perl user community to try to wrestle with concurrent tasks. The earliest of those that I recall was simply using select() to watch for the “first ready” I/O (or a timeout) simultaneously, and then dispatching to the proper handling routine. This was later wrapped into IO::Select. In parallel with that, the Event module was created, using an XS-level interface to handle filehandle readiness and signals in an orderly way.

Somewhere in here, a group of developers loosely coordinated by Rocco Caputo started developing and expanding the POE environment, which has become a powerful means to manage concurrent tasks within a process, or even multiple processes. See http://poe.perl.org for details.

At the lowest level of POE,…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Alternative Browsers: Beyond Chrome and Firefox
  2. Firefox 3.6 for Developers
  3. Firefox 3.6 Goes Gold
  4. Make Firefox a Productivity Powerhouse
  5. Become a Firefox Test Pilot
Follow Linux Magazine
Rackspace