Concurrency - Lambda based message passing
#3
Such a system would mostly work, but sometimes just passing messages is not adequate. Consider the cases when you need to ask something: "Is XY available?" or "Is there a player Z already connected?" You need to wait for the result somehow, and that's what actually introduces all the deadlocks.

Note that it would be quite difficult, if not impossible, to rewrite some of these. Checking the connecting player for duplicate name needs to be done before the player connection code is allowed to continue, and just scheduling everything would make the resulting code unreadable.

This technique is already used where it makes sense, such as queueing block updates in a world.
Reply
Thanks given by:


Messages In This Thread
RE: Concurrency - Lambda based message passing - by xoft - 02-17-2016, 09:50 PM



Users browsing this thread: 1 Guest(s)