mirror of
https://github.com/dunglas/frankenphp
synced 2024-10-16 17:14:59 +00:00
perf: hint the number of threads to TSRM (#655)
* perf: hint the number of threads to TSRM * fix: PHP 8.2 compat
This commit is contained in:
parent
71661c45e2
commit
b18a079eb9
13
frankenphp.c
13
frankenphp.c
@ -738,9 +738,16 @@ static void *manager_thread(void *arg) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int num_threads = *((int *)arg);
|
||||
free(arg);
|
||||
arg = NULL;
|
||||
|
||||
#ifdef ZTS
|
||||
// TODO: use tsrm_startup() directly as we know the number of expected threads
|
||||
#if (PHP_VERSION_ID >= 80300)
|
||||
php_tsrm_startup_ex(num_threads);
|
||||
#else
|
||||
php_tsrm_startup();
|
||||
#endif
|
||||
/*tsrm_error_set(TSRM_ERROR_LEVEL_INFO, NULL);*/
|
||||
#ifdef PHP_WIN32
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
@ -761,9 +768,7 @@ static void *manager_thread(void *arg) {
|
||||
|
||||
frankenphp_sapi_module.startup(&frankenphp_sapi_module);
|
||||
|
||||
threadpool thpool = thpool_init(*((int *)arg));
|
||||
free(arg);
|
||||
arg = NULL;
|
||||
threadpool thpool = thpool_init(num_threads);
|
||||
|
||||
uintptr_t rh;
|
||||
while ((rh = go_fetch_request())) {
|
||||
|
Loading…
Reference in New Issue
Block a user