Skip to content
Snippets Groups Projects
Commit ef3838a47503 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

worker: ability to disable thread unsafe tasks

The worker on Windows is implemented using a thread pool. If worker
tasks are not thread safe, badness can occur. In addition, if tasks
are executing CPU bound code and holding onto the GIL, there will be
non-substantial overhead in Python context switching between active
threads. This can result in significant slowdowns of tasks.

This commit teaches the code for determining whether to use a worker
to take thread safety into account. Effectively, thread unsafe tasks
don't use the thread-based worker on Windows.

Differential Revision: https://phab.mercurial-scm.org/D3962
parent 69ed2cff4277
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment