llm-ready-data / app /core /thread_pool.py
light-infer-chat's picture
ok
114194d
Raw
History Blame Contribute Delete
237 Bytes
from __future__ import annotations
import concurrent.futures
import os
_MAX_WORKERS = min(32, (os.cpu_count() or 1) + 4)
thread_pool = concurrent.futures.ThreadPoolExecutor(
max_workers=_MAX_WORKERS, thread_name_prefix="shared"
)