with TSX, it's easier to efficiently wait (without polling) on multiple locations in hardware than in software, with futexes :|
@pkhuong Hmm, what's the issue with futexes (assuming you have futex_waitv)?
@shachaf ah yes, we finally have windows parity :)
@pkhuong I think this was literally added for WINE or something like that?
@pkhuong Though as @francesco pointed out recently, io_uring also supports futex_wait now, so you can wait on multiple addresses with that as well.
@shachaf @pkhuong and note that io_uring works through the futex2 API, so you can wait on multiple futexes with a single io_uring submission, if you so wish.
@shachaf @pkhuong yeah, that's the primary reason. one of the (many) paths for sync primitives in wine just proxies them to futexes, which works out surprisingly well despite not really being an accurate emulation always.
@shachaf @pkhuong I had no idea they added this recently (2023 it looks like). That's awesome!

@pkhuong adding to my TODO here to learn about that. any good URLs youd recommend?

assuming TSX wasnt a joke, haha

@synlogic https://cdrdv2-public.intel.com/751859/Power_Mgmt_User_Wait_Instructions_Power_Saving_TechGuide_751859v4.pdf Intel's example is TPAUSE under RTM: start a transaction, check that your poll locations are still as expected (uninteresting), then just loop forever around around a power-efficient instruction.
@pkhuong ahhh, ok thanks! I'll read up.