summaryrefslogtreecommitdiff
path: root/tpool/task.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-24512 fixup: Remove after_task_callbackst-10.6-marko2Marko Mäkelä2021-09-141-17/+1
| | | | | | In commit ff5d306e296350e7489dd3decb01bad18d135411 we removed dbug_after_task_callback but forgot to revert the rest of commit bada05a88369051ee60623b006929dd728f704e8.
* MDEV-21674 purge_sys.stop() fails to wait for purge workers to completeMarko Mäkelä2020-02-071-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 5e62b6a5e06eb02cbde1e34e95e26f42d87fce02 (MDEV-16264), purge_sys_t::stop() no longer waited for all purge activity to stop. This caused problems on FLUSH TABLES...FOR EXPORT because of purge running concurrently with the buffer pool flush. The assertion at the end of buf_flush_dirty_pages() could fail. The, implemented by Vladislav Vaintroub, aims to eliminate race conditions when stopping or resuming purge: waitable_task::disable(): Wait for the task to complete, then replace the task callback function with noop. waitable_task::enable(): Restore the original task callback function after disable(). purge_sys_t::stop(): Invoke purge_coordinator_task.disable(). purge_sys_t::resume(): Invoke purge_coordinator_task.enable(). purge_sys_t::running(): Add const qualifier, and clarify the comment. The purge coordinator task will remain active as long as any purge worker task is active. purge_worker_callback(): Assert purge_sys.running(). srv_purge_wakeup(): Merge with the only caller purge_sys_t::resume(). purge_coordinator_task: Use static linkage.
* tpool - implement post-task callback (for Innodb debugging)Vladislav Vaintroub2020-01-121-0/+16
|
* MDEV-16264: Add threadpool libraryVladislav Vaintroub2019-11-151-0/+68
The library is capable of - asynchronous execution of tasks (and optionally waiting for them) - asynchronous file IO This is implemented using libaio on Linux and completion ports on Windows. Elsewhere, async io is "simulated", which means worker threads are performing synchronous IO. - timers, scheduling work asynchronously in some point of the future. Also periodic timers are implemented.