Multi-threading how-to

Cauterite via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 31 10:53:27 PDT 2016


On Wednesday, 31 August 2016 at 17:37:25 UTC, solidstate1991 
wrote:
> I decided to add a functionality that if multiple programs use 
> the same instance of the library on the same computer, the 
> messages will be passed directly instead of via networking.

What you're describing here is not actually multi-threading, it's 
multi-process…ing. The keyword you're looking for is 
"inter-process communication".

You have a huge range of possible options for implementing this. 
Your decision would depend on your operating system, your 
existing implementation with sockets, and desired performance.

My suggestion: try just using sockets between processes on the 
same PC. You might not even need to add any new code to support 
this method, and it might be faster than you'd expect.




More information about the Digitalmars-d-learn mailing list