Overview
Artifact ID: | 36fff07b2388f9e37c75a5e3d08bd332c8be68a9c0238059de08e056262dddcd |
---|---|
Ticket: | 31d9fb57cc9a777a67dd60bfc14462f838ed42f9
OFRunLoop: Only use OFKernelEventObserver if we have sockets |
User & Date: | js on 2020-06-22 00:37:54 |
Changes
- icomment:
<p><code>OFRunLoop</code> currently always uses <code>OFKernelEventObserver</code> if ObjFW is compiled with support for sockets and <code>OFKernelEventObserver</code> initializes the network in its <code>+[initialize]</code>. On some systems (e.g. Wii), initializing the network takes quite a while, resulting in quite a lengthy startup time when the main run loop is initialized.</p> <p>It would be much better to only initialize <code>OFKernelEventObserver</code> once a socket is added to the run loop, and always fall back to using conditions until a socket is added. At which point sockets are already initialized anyway and <code>select()</code> and similar are available.</p> <p>This could even be improved further on some systems by asynchronously initializing sockets: Sockets initialization could be started asynchronously early on, and the synchronous sockets initialization used by many classes could then just wait for the async initialization to be done. This would allow to have all non-socket code running without delay, and possibly sockets already being initialized by the time the application wants to use them, instead of only starting initialization once the application wants to use sockets.</p>
- login: "js"
- milestone changed to: "1.0"
- mimetype: "text/html"
- priority changed to: "Immediate"
- severity changed to: "Important"
- status changed to: "Open"
- title changed to:
OFRunLoop: Only use OFKernelEventObserver if we have sockets
- type changed to: "Nice_To_Have"