#Shared memory

31 messages · Page 1 of 1 (latest)

surreal bay
#

Generally, use an Arc,

#

It's kept on the heap, and the reference counting means the memory has a lifetime which will last, as long as a thread has a handle to the memory,

#

Or channels, if you want to use a unidirectional system for sending data...

scenic trail
#

What is a process in this context?

#

The above advice is not suitable then

#

You're looking for "inter process communication"

#

If you can avoid having multiple processes that would be better

surreal bay
#

Oof... I read it as "threads" instead...

#

Yeah, if you need shared memory, using threads would be more appropriate, if possible.

tender heathBOT
#

A multiprocess drop-in replacement for Rust channels

Version

0.16.0

Downloads

570 635

sullen mantle
#

Is the sort of go to

true sleet
#

or something like remoc would work

vapid sleet
#

what are you exactly trying to do?

#

launch executable a from rust program b?

#

you might not need ipc

#

This should've been the first question

#

Do you want any other communication or just detect if it's open or not? (e.g. as in game launchers where they have to detect whether it's open but no more than that)

#

IPC is not meant for this

#

I am thinking create a blank file from the child program and delete it when you close the program

#

Maybe you want to do this with a blank rust app first, then integrate that into your main program

#

Does that make sense?

#

reg?

#

why would you do that?

#

there's a few cons I can think of if you do that:

  • need admin privilidges
  • not cross platform
  • not strictly needed in this case/simpler alternatives
#

you can do that

#

But I wouldn't recommend

#

okay

#

no prob

vapid sleet
#

I didn't know. Thanks for sharing your knowledge!