Kernel może dostać w końcu…

Kernel może dostać w końcu poprawkę dodającą Futex2 – czyli wywołanie systemowe poprawiające wydajność w grach uruchamianych przez Wine.
Z tego co rozumiem to powinno chyba zastąpić ESYNC.

Some modern games can have a high number of threads running at the same time, and to ensure that they don’t modify data in critical section concurrently, we need synchronization mechanisms. Windows API provides a mechanism that is used to make a thread wait on multiple locks at the same time, and if any of them signal, the thread wakes. This function is used by some games/engines, so Wine needs to translate to a similar mechanism in Linux.

The most similar one that we have in mainline Linux is the eventfd(), where you can poll for multiple file descriptors at the same time, and when one signal, the caller is notified, and the mechanism for doing that is Wine is called ESYNC. However, this approach proved to not scale well in some loads generated by modern games (read more here).

The proper synchronization mechanism provide by the Linux kernel to the userspace is called futex (fast user mutexes), that exposes some simple system calls that libc/Wine can use in order to implement a fast mutex in userland. The mainline futex() API doesn’t have support for waiting on multiple futexes, but the Linux Zen and some others custom kernels do have support for that. The sync mechanism in Wine that uses the modified futex() with support to „wait on multiple” is called FSYNC.

#linux #gry