[erlang-questions] Mysterious gen_server timeouts in MIX

Vance Shipley vances@REDACTED
Sat Nov 2 12:35:28 CET 2013


On Sat, Nov 02, 2013 at 03:15:11PM +0530, Vance Shipley wrote:
}  Here is an example of a pathological program which will eventually
}  deadlock:
...
}  handle_call(N, _From, State) ->
}  	{reply, N + 1, State, 0}.

Small correction, the previous example probably timed out because my
MacBookPro went to sleep.  The small change here demonstrates the
problem quicker and more reliably:

	handle_call(N, _From, State) ->
		{reply, N + 1, State, random:uniform(100)}.

The small random timeout greatly increases the chance of entering a race.

-- 
	-Vance



More information about the erlang-questions mailing list