Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Communication between processes

by TheMarty (Acolyte)
on Nov 05, 2004 at 13:53 UTC ( [id://405494]=perlquestion: print w/replies, xml ) Need Help??

TheMarty has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've got two perl programs (compiled to .exe with PerlApp). One is a processing engine doing the job, and second one is a GUI for it (used mostly to configure main tool before starting, etc.). However, during the processing the main tool should communicate with GUI, to give some information, like current progress status. Based on this, the GUI should display some info and progress bar. All this should work both on Win32 and Linux/Unix (eventually could not work on Unix, but at least should not crash the whole thing). As far now I've solved the whole thing through files -> main engine writes the log file, and GUI reads it in some time interval, and sets progrss bar, etc. Problem is, that it works too slow. Meaning - main engine writes the information with HUGE delay (i set the "flush" option to the smallest possible, but it does not help really). So, I think there is some method two processes to communicate. Unfortunately, nothing is feasible.

Replies are listed 'Best First'.
Re: Communication between processes
by gaal (Parson) on Nov 05, 2004 at 14:20 UTC
    Read up on perlipc. Having the two processes communicate by a TCP socket seems like a good choice; that way they don't even need to be on the same machine (at least as far as the progress bar is concerned!).
Re: Communication between processes
by Prior Nacre V (Hermit) on Nov 05, 2004 at 14:22 UTC

    It sounds like IO::Socket should do what you want.

    There's quite a few examples of usage in the Camel Book (Chap.16 - Interprocess Communication). This should also be available at perlipc but Perldoc.com appears to be down at the moment so I can't check.

    Regards,

    PN5

Re: Communication between processes
by jfroebe (Parson) on Nov 05, 2004 at 14:57 UTC

    Hi,

    Check out IPC::Shareable, which allows you to share variables using shared memory. That is if the client is running on the same machine as the server. Very simple to use

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      IPC::Shareable looks good, but I can't find version for Windows (it need SysV module, and that one uses binary library - in case of Windows DLL :-( Theoretically it should be inlcuded in Perl 5.8.5. I'm using ActiveState, but the version is 5.8.4, and there is no SysV lib at all :-( Where can i find it? (Compilation is not possible, I do not have any c compiler on my PC).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://405494]
Approved by pelagic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found