aboutsummaryrefslogtreecommitdiff
path: root/src/core/taskq.h
Commit message (Collapse)AuthorAge
* fixes #1236 Deadlock triggered on nng_closeGarrett D'Amore2020-05-17
| | | | fixes #1219 nng_close occasionally hang on Windows
* fixes #1117 task structures should be inlinedGarrett D'Amore2020-01-06
|
* fixes #445 crash in taskq_threadGarrett D'Amore2018-05-16
| | | | | | | | This changes the array of flags, which was confusing, brittle, and racy, into a much simpler reference (busy) count on the task structures. This allows us to support certain kinds of "reentrant" dispatching, where either a synchronous or asynchronous task can reschedule / dispatch itself. The new code also helps reduce certain lock pressure, as a bonus.
* fixes #433 tasks can leakGarrett D'Amore2018-05-15
| | | | | | While here I also improved the taskq.h comments (and removed a stale prototype for nni_task_cancel), and addressed leaks in the reqstress and multistress test programs.
* fixes #352 aio lock is burning hotGarrett D'Amore2018-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #326 consider nni_taskq_exec_synch() fixes #410 kqueue implementation could be smarter fixes #411 epoll_implementation could be smarter fixes #426 synchronous completion can lead to panic fixes #421 pipe close race condition/duplicate destroy This is a major refactoring of two significant parts of the code base, which are closely interrelated. First the aio and taskq framework have undergone a number of simplifications, and improvements. We have ditched a few parts of the internal API (for example tasks no longer support cancellation) that weren't terribly useful but added a lot of complexity, and we've made aio_schedule something that now checks for cancellation or other "premature" completions. The aio framework now uses the tasks more tightly, so that aio wait can devolve into just nni_task_wait(). We did have to add a "task_prep()" step to prevent race conditions. Second, the entire POSIX poller framework has been simplified, and made more robust, and more scalable. There were some fairly inherent race conditions around the shutdown/close code, where we *thought* we were synchronizing against the other thread, but weren't doing so adequately. With a cleaner design, we've been able to tighten up the implementation to remove these race conditions, while substantially reducing the chance for lock contention, thereby improving scalability. The illumos poller also got a performance boost by polling for multiple events. In highly "busy" systems, we expect to see vast reductions in lock contention, and therefore greater scalability, in addition to overall improved reliability. One area where we currently can do better is that there is still only a single poller thread run. Scaling this out is a task that has to be done differently for each poller, and carefuly to ensure that close conditions are safe on all pollers, and that no chance for deadlock/livelock waiting for pfd finalizers can occur.
* More reliable taskq fini; avoids deadlock during shutdown.Garrett D'Amore2017-08-02
|
* Simpler taskq API.Garrett D'Amore2017-07-21
| | | | | | | The queue is bound at initialization time of the task, and we call entries just tasks, so we don't have to pass around a taskq pointer across all the calls. Further, nni_task_dispatch is now guaranteed to succeed.
* Always run the AIO completion logic.Garrett D'Amore2017-07-19
| | | | | | | | We have seen some yet another weird situation where we had an orphaned pipe, which was caused by not completing the callback. If we are going to run nni_aio_fini, we should still run the callback (albeit with a return value of NNG_ECANCELED or somesuch) to be sure that we can't orphan stuff.
* Give up on uncrustify; switch to clang-format.Garrett D'Amore2017-07-10
|
* Fix taskq_cancel race.Garrett D'Amore2017-06-08
|
* Introduce new generic I/O event framework.Garrett D'Amore2017-02-19
|
* Taskq implementation.Garrett D'Amore2017-02-18