Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用多线程能起到加速效果吗? #1

Open
KenyonY opened this issue Apr 29, 2024 · 1 comment
Open

使用多线程能起到加速效果吗? #1

KenyonY opened this issue Apr 29, 2024 · 1 comment

Comments

@KenyonY
Copy link

KenyonY commented Apr 29, 2024

BBPE/bbpe.py

Line 124 in 3573822

with ThreadPoolExecutor(max_workers=num_threads) as executor:

如题,这里使用python多线程的作用是?

@algorithmexplorer
Copy link
Contributor

提高程序的性能和效率,但效果一般。由于Python的全局解释锁(Global Interpreter Lock,GIL)而无法实现真正的并行。
如果想加速,建议使用多进程来代替多线程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants