<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 6, 2010, at 8:21 AM, Bert Freudenberg wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 18.12.2009, at 19:58, Josh Gargus wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><div>messages and that any #future: messages sent with the same delay should be queued in the order they are sent. </div></div></blockquote><div><br></div>Without question. &nbsp;This is a limitation of the current implementation.</div></div></blockquote></div><div><br></div><div>Thinking about this, I'd suspect using&nbsp;#addAlarm:withArguments:for:at: instead of #addDeferredUIMessage: might be both more efficient and possibly order-preserving. It uses a Heap to sort future message sends.</div></div></blockquote><div><br></div><div><br></div>That's a great idea. &nbsp;I'll look into that this weekend.</div><div><br></div><div>The alarm heap isn't order-preserving as-is. &nbsp;However, if we add a sequence number to MorphicAlarm and include it in the sort-block (as is done for replicated Croquet messages), then it will be. &nbsp;I like this a lot... we'll be improving existing code in Morphic instead of adding another queue.</div><div><br></div><div>Implementation detail: I'll probably have to use an #addDeferredUIMessage: to send the #addAlarm:withArguments:for:at:, since access to the alarm heap isn't synchronized.&nbsp;</div><div><br></div><div>Thanks,</div><div>Josh</div><div><br></div><div><br></div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" color="#000000"><br></font><div>
<span class="Apple-style-span" style="font-size: 12px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div></span></div><br></div><br></blockquote></div><br></body></html>