RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.66k stars 1.93k forks source link

sys_event: Implement EBUSY for disconnection #16266

Closed elad335 closed 4 weeks ago

elad335 commented 1 month ago

For a while I was not sure on what was purpose of the EBUSY, after all sending event is not expected to be a blocking call. But, after looking at the disassembly it makes more sense, as this prevents port disconnection and destruction from being blocking calls, potentially waiting for a sleeping PPU thread with a low priority to release port handle reference after sending an event. This only affects sending events from userbase PPU threads, as for RSX and SPU, system PPU threads with negative priority are used. This sort of optimization (thread-block avoidance) of the PS3 firmware is not implemented in other synchronization primitives, perhaps because event sending is done very frequantly as well as in LV1 and LV2 themselfs.

nsautter commented 4 weeks ago

This commit (16266) causes a game freeze for Warhawk on startup.

Warhawk works in 0.0.33-17071, but freezes on launch for 0.0.33-17072.

It would be great if we could do something to get this reverted.