Multi-threading how-to
H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 31 10:54:38 PDT 2016
On Wed, Aug 31, 2016 at 05:53:27PM +0000, Cauterite via Digitalmars-d-learn wrote:
> 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.
[...]
If you're on Posix (Linux, *nix, etc.), you could also use pipes, which may
be easier to setup.
T
--
A linguistics professor was lecturing to his class one day. "In English," he said, "A double negative forms a positive. In some languages, though, such as Russian, a double negative is still a negative. However, there is no language wherein a double positive can form a negative." A voice from the back of the room piped up, "Yeah, yeah."
More information about the Digitalmars-d-learn
mailing list