• Note that some bits of WINE really want custom support in the kernel. The implementation of WaitForMultipleObjects comes to mind. Linux and FreeBSD (not sure about macOS?) have custom kernel APIs specifically to make this efficient.


      score 1 · canonical

      • Anyone who has ever implemented a cross-platform “WaitForMultiple” that is inspired by Windows knows how incredibly cursed this is and how hard it is to get robust and right. I once had the (dis)pleasue of maintaining such a cross-platform API that supported Windows, Linux, QNX, FreeRTOS, MQX and Micrium OS. The Windows implementation of that part of the library was basically just a wrapper, but the other operating systems… Oh boy.


        score 1 · canonical

          • Unfortunately, I don’t have time to explain it in great detail, also it may contain some details of proprietary projects. Basically it was a library that provided:

            • Threading
            • Mutexes
            • Events
            • File system (including RAM file system)
            • Network communication
            • Logging

            to Windows, Linux, QNX, FreeRTOS, MQX and Micrium OS. The exact same API providing all this functionality from machines ranging from desktop computer to embedded CPU with 1MB of on-chip RAM. Meaning all the code built on top of this library could be shared and identical between all these systems and architectures. And they all could communicate with each other with the same proprietary protocol that supported connections via:

            • Serial
            • USB
            • EtherCAT
            • TCP/IP
            • Bluetooth

            It was pretty glorious. Despite the difficulties, I miss the elegance of this abstraction. Unfortunately, almost all the engineers who understood the elegance of it and how the entire thing works have left the company by now, so I guess future projects will have a gajillion different proprietary protocols again and all the implementations will be duplicated tenfold.


            score 1 · canonical