official-stockfish / fishtest

The Stockfish testing framework
https://tests.stockfishchess.org/tests
270 stars 126 forks source link

Refactored locking algorithm in the worker #2083

Open vdbergh opened 1 week ago

vdbergh commented 1 week ago

The locking code in the worker is a bit messy, so I took it out and refactored it as a separate package https://pypi.org/search/?q=openlock . The GitHub repository is here https://github.com/vdbergh/openlock .

I would propose to include this in the worker. However the question is how?

The package is basically two files. The main code is openlock.py and the unit tests are in test_openlock.py.

test_openlock.py should obviously go in the tests directory.

openlock.py can go in packages.

Is there a better solution?

I am a bit hesitant to include openlock.py in the root directory of the worker since for ages the worker has been basically three files.

Disservin commented 1 week ago

my two cents

? I think I asked pasquale some time ago if there were any issues with introducing new files since it would be a nice step in cleaning up some worker code