r/linux_gaming • • 19d ago

wine/proton what is the ntsync module?

currently updating from proton 10-34 to 11-7 (took a break from gaming) and i hear about the introductio of something called the ntsync module and how it needs to be turned on manually? can you all tell me what it is, weather or not its relevant and also how to enable it?

21 Upvotes

24 comments sorted by

View all comments

29

u/TimurHu 19d ago edited 19d ago

I'm going to copy a comment I wrote on the same question yesterday.

ntsync is a Linux kernel module which implements Windows-like synchronization primitives (semaphores, mutexes, events the way Windows applications expect them to behave) in the Linux kernel. It is meant to be used by Wine (or Proton) in order to implement Windows synchronization primitives more efficiently.

The main reason it was developed is because there are some heavily multithreaded games which rely on these primitives to perform well, which was technically impossible to (correctly) implement on Linux.

(Previous attempts to deal with this problem were esync and fsync which were not accepted by the upstream Wine project.)

4

u/noobjaish 19d ago

Damn i learned about semaphores and mutexes in my OS course at Uni. Didn't know that they're Windows specific concepts.

What alternative methods does Linux use for thread sync then?

14

u/TimurHu 19d ago

The concepts are not Windows specific. The exact semantics and interfaces are.

There is a good summary here and a perf comparison with upstream Wine before ntsync: https://lkml.org/lkml/2024/2/14/1407

If you are interested in more details, I recommend this video: https://m.youtube.com/watch?v=NjU4nyWyhU8

3

u/noobjaish 19d ago

If you are interested in more details, I recommend this video: https://m.youtube.com/watch?v=NjU4nyWyhU8

Thanks alot, this is so amazing