interprocess communication and sharing memory

thedeemon via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 3 00:02:48 PDT 2015


On Thursday, 3 September 2015 at 02:52:00 UTC, Laeeth Isharc 
wrote:
> On Thursday, 3 September 2015 at 01:27:15 UTC, j55 wrote:
>> This is my first attempt at a project in D, so pardon me if 
>> I'm overlooking something obvious:
>>
>> I'm using libasync to create an eventloop, to set up something 
>> like a server/daemon process.  This part works very well.  
>> We'll call this Server A.
>>
>> Now I'd like to write another process (running on the same 
>> computer), we'll call Client B, and pass signals in to Server 
>> A.

> It's probably a stupid idea, but until someone with experience 
> answers: what happens if you declare the memory as shared or 
> __gshared and send a pointer to it via message passing or a 
> pipe?

Pointer from one process doesn't make any sense in another 
process, they point to different data in different address 
spaces, and most probably in the second process memory at this 
"address" isn't even allocated by the app, so it would be an 
access violation.


More information about the Digitalmars-d-learn mailing list