Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Shared memory and asynchronous access

by jmlynesjr (Deacon)
on Apr 05, 2017 at 16:18 UTC ( [id://1187154]=note: print w/replies, xml ) Need Help??


in reply to Shared memory and asynchronous access

Also take a look at SDR Scanner(aka Threaded wxPerl Example). It uses shared variables to communicate between the GUI and the processing code.

James

There's never enough time to do it right, but always enough time to do it over...

Replies are listed 'Best First'.
Re^2: Shared memory and asynchronous access
by vef445 (Novice) on Apr 05, 2017 at 16:26 UTC

    Thanks James, but I think there is a confusion between variable in a same script and different, independent scripts. I have other threads running in this application and I have had no problem sharing variables (using Threads::shared it's very easy), generating events...etc.

    Again, my main issue to share information between two processes that are completely independent. It seems that shared memory (there are different packages/solutions out there) is my solution but maybe you have better suggestion since I'm not able to put it in place (except on Mac/Linux).

      Ah... Currently, MCE and MCE::Shared do not work for two or more processes that are completely independent. It seems like the next step to tackle. All the parts are there. Basically, what's missing is for the shared-manager to support TCP/IP. That will be awesome if it could do that.

      MCE now includes MCE::Mutex::Flock supporting threads and processes. That includes two or more completely independent processes. It's a start, but TCP/IP is needed regarding the shared-manager. Who knows, it might happen. MCE::Mutex::Flock was added recently.

      Thank you, vef445++. Thank you, Perlmonks++.

        In my research I actually found some packages that allow TCP/UDP socket read and write. I would imagine that in many cases, when one application must read a stream from another, UDP is a good solution. I didn't go that route since I couldn't imagine asking my end-users to make sure their firewall is open on port XXX for what is, for the user, a single autonomous application.

        Right now, I'm modifying the architecture or this little application so the main script "gui.pl" will call the second one by importing its subroutine(s), not by executing it. So far it's not many modifications. WIP...

        I appreciate all the effort people have put in my question :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-28 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found