bk99.de entertain the web since 1997

Linux kernel to get Windows API for synchronisation

Summary

In January 2024 Codeweavers developer Elizabeth Figura proposed the NTSync kernel driver, which implements functions of Windows NT thread synchronisation directly in the Linux kernel. Predecessors such as Esync and Fsync/Futex2 reached their limits because the complex NT semantics could not be reproduced correctly with existing primitives. In some games NTSync is said to increase the frame rate by 50 to 150 percent, while in others it changes hardly anything.

Ideas

  • Wine has to reproduce Windows synchronisation objects as exactly as possible.
  • Threads should be able to wait for several objects at the same time.
  • Some operations need direct control that is not possible in user space.
  • Valve and Codeweavers drove the development forward for years.

Insights

  • At some point compatibility layers reach the limits of the host system and need kernel support.
  • With synchronisation, correctness matters more than a clever imitation.

Facts

  • Work on better thread synchronisation in Wine had begun more than four years earlier.
  • Figura presented the concept at the Linux Plumbers Conference.

References

Critique

  • The performance figures come from the developers’ tests and vary greatly between individual games.

Recommendations

  • Update the kernel and Proton to benefit from new synchronisation mechanisms.
  • Measure performance gains in games yourself instead of trusting averages.

Read the original article

Search the Web Archive