in reply to simple IPC

This is trivial using threads.


Examine what is said, not who speaks.        The end of an era!
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: simple IPC
by BrowserUk (Patriarch) on Dec 23, 2004 at 23:33 UTC

    I said it was trivial:)

    #! perl -slw use strict; use threads; use threads::shared; my @myarray : shared; sub pid { lock @myarray; push @myarray, $_[ 0 ]; } threads->new( \&pid, $_ )->detach for 1 .. 3; sleep 2; print "@myarray"; __END__ [23:30:52.15] P:\test>417163 1 2 3

    Examine what is said, not who speaks.        The end of an era!
    "But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
    "Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon