Parallel Computing - Communication between threads

Asked

Viewed 45 times

0

This is a question that arose to me when I was trying to solve a problem in a client, the problem turned out to be something else but the doubt continued.

Imagine a situation where there are two programs, prog1 and prog2, where a dll causing when the prog1 fires an event the prog2 receives this event and gestiona.

Example:

prog1 executes a calling establishment

prog2 executes OnEstabelecimentoDeChamada

Since they are being executed asynchronously and at this point there is a communication between the two and as argument of that call the prog1 passes an object to prog2. The question is, how does the stack run of both programs? What happens if another event is called in prog1 while prog2 is still running the OnEstabelecimentoDeChamada?

I tried to be as clear as possible, I would like to know how the calls properly look in the execution stack

1 answer

0

Usually when systems communicate this procedure, it is done in separate execution segments, that is, both the process of establishing communication and the methods themselves of exchanging messages are executed in separate threads. This is because in the scenario where there is an unavailability of one of the parts none of the programs would be "stuck" to communication failure.

So, this means that a separate execution stack from the program’s main call stack should be used to maintain communication and availability of the other functionalities on both systems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.