<div dir="ltr"><span style="font-size:14px">talk is cheap, show the code. ^_^</span><div style="font-size:14px"><br></div><div style="font-size:14px"><div>-module(t).</div><div>-export([main/0]).</div><div>main() -></div><div>                Pid = spawn(fun()->test2() end),</div><div>                erlang:send_after(1000,Pid, 1),</div><div>                erlang:send_after(1000,Pid,2).</div><div>test2() -></div><div><br></div><div>                receive </div><div>                                A -> </div><div>                                        io:format("dddd:~p~n",[A]),</div><div>                                        test2()</div><div>                end.</div></div><div style="font-size:14px"><br></div><div style="font-size:14px">--------------------------------------------------------------------------------------------------------</div><div style="font-size:14px">this output is:</div><div style="font-size:14px">dddd:2<br></div><div style="font-size:14px">dddd:1<br></div><div style="font-size:14px"><br></div><div style="font-size:14px">then , I find this in time.c</div><div style="font-size:14px"><br></div><div style="font-size:14px"><div><b>    /* insert at head of list at slot */</b></div><div><b>    p->next = tiw[tm];</b></div><div><b>    p->prev = NULL;</b></div><div><b>    if (p->next != NULL)</b></div><div><b><span style="white-space:pre-wrap"> </span>p->next->prev = p;</b></div><div><b>    tiw[tm] = p;</b></div></div><div style="font-size:14px"><br></div><div style="font-size:14px">it insert head when we insert message</div><div style="font-size:14px"><br></div><div style="font-size:14px"><br></div><div style="font-size:14px"><div><b>/* Remove from list */</b></div><div><b>remove_timer(p);</b></div><div><b>*timeout_tail = p;<span style="white-space:pre-wrap">   </span>/* Insert in timeout queue */</b></div><div><b>timeout_tail = &p->next;</b><b><span style="white-space:pre-wrap">               </span></b></div></div><div style="font-size:14px"><br></div><div style="font-size:14px">it insert tail when it timeout.</div><div style="font-size:14px"><br></div><div style="font-size:14px">----------------------------------------------------------------------------</div><div style="font-size:14px">Q: but why ? if message timeout, we can insert head. it can keep the order of message. why don't do this? </div><div style="font-size:14px"><br></div><div style="font-size:14px">other: my English is poor. if something wrong, i hope you forgive me.</div></div>