On Tue Apr 8 23:18:26 2025 +0000, Elizabeth Figura wrote:
Why do you need to plumb anything into the Unix library? Generally speaking I would imagine you can achieve this by using a PE-side mutex, which is acquired by the Unix thread, and released only when calling functions. Better—assuming I remember correctly that the synchronous reader is indeed supposed to synchronously read from the same thread—would probably be to get rid of the read thread, add the ability to check for read requests without blocking, and actually perform reads directly when waiting for samples. I made this proposal some time ago, but it was ignored, like many others.
I did consider removing the read thread, quoting myself from CodeWeavers tracker, replying to a comment from @rbernon.
... getting rid of the read thread would basically mean a full redesign of wg_parser. and from what I heard from you a redesign/alternative is already in the works? (although i am not clear what the plan/current progress is). so it doesn't make sense to duplicate the work.
Unless you think there's a way to use `wg_parser` without the read thread?
Not sure exactly how you would suggest using a PE-side mutex to implement this. One way I tried couldn't account for `WMSyncReader` method being called concurrently. This MR makes sure that the read thread can read iff there is >= 1 threads inside `WMSyncReader` methods.