process sleeps

Ulf Wiger (AL/EAB) ulf.wiger@REDACTED
Tue Apr 25 15:37:14 CEST 2006


 
No, it will just fall through. 
 
timer:sleep(0) is equivalent to 
 
receive
after 0 -> ok
end
 
There is nothing to wait for, so the process won't sleep.
 
BR,
Ulf W


________________________________

	From: owner-erlang-questions@REDACTED
[mailto:owner-erlang-questions@REDACTED] On Behalf Of Yani Dzhurov
	Sent: den 25 april 2006 14:35
	To: erlang-questions@REDACTED
	Subject: process sleeps
	
	

	Hi guys,

	 

	I wondered whether timer:sleep(0) would cause a process to sleep
or it will just pass it ?

	For instance if I have spawned process with fun();

	 

	fun()->

	            bar(),

	            baz(),

	            timer:sleep(0),

	            bar().

	Would the process sleep after baz(), or not ?

	 

	10x,

	 

	yani

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060425/d0a2cd54/attachment.htm>


More information about the erlang-questions mailing list