0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-v8-flag-pool-size-0.js
Daeyeon Jeong 47d3adb825
src: set an appropriate thread pool size if given --v8-pool-size=0
It doesn't terminate when any pending V8 tasks exist if no thread
is in the pool.

This allocates one thread at least for V8's background tasks if
`--v8-pool-size=0` is given as a CLI option.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45513
Fixes: https://github.com/nodejs/node/issues/42523
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2022-11-21 02:14:28 +00:00

11 lines
284 B
JavaScript

// Flags: --v8-pool-size=0 --expose-gc
'use strict';
require('../common');
// This verifies that V8 tasks scheduled by GC are handled on worker threads if
// `--v8-pool-size=0` is given. The worker threads are managed by Node.js'
// `v8::Platform` implementation.
globalThis.gc();