Created
August 31, 2012 14:41
-
-
Save JayBeavers/3553827 to your computer and use it in GitHub Desktop.
Contents removed, pull request submitted in place of this prototype
Updated the design so that uv_work_t is used for both thread and queue samples and using the uv_default_loop for calling after_work_cb from background thread -- this keeps the node-serial write callback on the expected thread.
usleep is not platform agnostic and I haven't found a libuv equivalent of usleep(...). They added uv_sleep to their test harness, looks like this will need to be IFDEF'd.
Swapped out ngx_queue_t, the standard libuv queuing implementation, for stl queue
Switched from mutex to semaphore per advice on #libuv
Contents removed as a pull request for the full fix is now in place.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uv_work_queue is a 'simple as possible' repro of the out of order problem that occurs when using uv_queue_work to post data to be background processed. When you run it you will see Out of Order messages in the console.
uv_thread is a rewrite that uses a mutex locked FIFO queue to submit the data to be processed and a dedicated background thread to service the queue in order. When you run it no Out of Order messages are written.