<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I was talking about the *dispatch* run loop code. I'm not sure it's needed. The main queue is a different story. <br><br>-Pierre on his iPhone</div><div><br>On 11 déc. 2015, at 11:28, Tony Parker via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org">swift-corelibs-dev@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 11:25 AM, Pierre Habouzit via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 9:57 AM, Pierre Habouzit via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Dec 11, 2015, at 9:02 AM, Philippe Hausler via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">This is only tangentially related: but I was attempting to build dispatch as well to start work on CFRunLoop and a few other dispatch bound features in Foundation on linux. I was seeing similar failures as Dzianis Fedarenka. Is there a branch/fork that I can grab to test this stuff out w/ bringing stuff up in Foundation?</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">My question is that of design and status of where things are at; CFRunLoop requires a method to interoperate with the main dispatch queue via _dispatch_get_main_queue_port_4CF and _dispatch_main_queue_callback_4CF. CFRunLoop will need to transact upon the same event source type as dispatch to ensure the main queue behaves correctly - so what type of event source should we be using? A socket? A producer/consumer notification via pthread conditions?</div></div></blockquote><div class=""><br class=""></div><div class="">The linux equivalent to what we’re doing for the runloop is to use an eventfd() to replace sending messages to its port.</div></div></div></blockquote><div class=""><br class=""></div>Though the runloop code should be disabled on linux right now, as it’s highly dependent on mach ports, and we should discuss whether having a dispatch queue attached to the runloop makes sense for the non mach version, and if it does, should it have exactly the same queue_runloop implementation as today. I think not, and the simplest way to port the implementation is to have a different implementation for linux completely and not rely on the weird 4CF hooks that we have on OS X.</div><div class=""><br class=""></div><div class="">-Pierre</div></div></div></blockquote><div><br class=""></div><div>We already have a Windows implementation in there that uses HANDLE, so we are not completely dependent on mach ports.</div><div><br class=""></div><div>I think it’s critical for portability that we maintain the concept of dispatch_main and CFRunLoop main thread integration. The exact mechanism is something we can design, but we have a fairly proven pattern here that would be straightforward to port.</div><div><br class=""></div><div>- Tony</div></div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ST9LHNQ2kYRKURQJ7G-2FmGJ7cPtWGB-2BbbnqmgrSbiwvi9QQ-2FWB5KWs6rcM6l8VQ5nS5VTFiIUXIYSn7xEsP9l4BbkC8Id329Wp0JEm-2B04atg77UtyLOAMdbIJLXne6U8ASY3g8DBCMlYVKyDI8K16GvXWBcndX8UgSqwCfFQozqZBseu1stxOo6snhlM9FWfgdN76EEOYGmXm2HzJlaRV6nyLwpWupzRTm3-2FUvnvvXew-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-corelibs-dev mailing list</span><br><span><a href="mailto:swift-corelibs-dev@swift.org">swift-corelibs-dev@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a></span><br></div></blockquote></body></html>