diff options
author | Eric Wong <e@80x24.org> | 2021-01-10 12:15:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-12 03:51:42 +0000 |
commit | 4e54b398ad511e5177ae2cc2243eba9408f840a8 (patch) | |
tree | 922e7bc8ffa8c073e3ce7182ea3d76010838af95 /t | |
parent | 6cc0e6870cb4950c08646769f2a7e30729b7d409 (diff) | |
download | public-inbox-4e54b398ad511e5177ae2cc2243eba9408f840a8.tar.gz |
IO::FDPass is our last choice for implementing the workqueue because its lack of atomicity makes it impossible to guarantee all requests of a single group hit a single worker out of many. So the only way to use IO::FDPass for workqueues it to only have a single worker. A single worker still buys us a small amount of parallelism because of the parent process.
Diffstat (limited to 't')
-rw-r--r-- | t/ipc.t | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -171,13 +171,17 @@ is($warn[2], $warn[1], 'worker did not die'); $SIG{__WARN__} = 'DEFAULT'; is($ipc->wq_workers_start('wq', 1), $$, 'workers started again'); is($ipc->wq_workers, 1, '1 worker started'); -$ipc->wq_worker_incr; -is($ipc->wq_workers, 2, 'worker count bumped'); -$ipc->wq_worker_decr; -$ipc->wq_worker_decr_wait(10); -is($ipc->wq_workers, 1, 'worker count lowered'); -is($ipc->wq_workers(2), 2, 'worker count set'); -is($ipc->wq_workers, 2, 'worker count stayed set'); +SKIP: { + $ipc->WQ_MAX_WORKERS > 1 or + skip 'Inline::C or Socket::MsgHdr not available', 4; + $ipc->wq_worker_incr; + is($ipc->wq_workers, 2, 'worker count bumped'); + $ipc->wq_worker_decr; + $ipc->wq_worker_decr_wait(10); + is($ipc->wq_workers, 1, 'worker count lowered'); + is($ipc->wq_workers(2), 2, 'worker count set'); + is($ipc->wq_workers, 2, 'worker count stayed set'); +} $ipc->wq_close; is($ipc->wq_workers, undef, 'workers undef after close'); |