TSX! What is it good for?

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,723
4,686
75
Absolutely nothin'! Say it again!

Wait, that can't be right. ;)

OK, let's start with the basics. Existing software can't generally take advantage of TSX - right? On the other hand, I heard about a Quake 3 server being faster with TSX than without. So does running or recompiling multithreaded software with TSX enabled instantly make it faster?

If software has to be written to take advantage of TSX, compilers have to be too, I assume. So which compilers are or soon will be written to take advantage of TSX - preferably without intrinsics specific to TSX? I assume Visual Studio will get there at some point - is it there yet? What about open-source compilers, like GCC, and interpreters like Python and Ruby?

I saw mention in [thread=2323577]this thread[/thread] that TSX may be useful for detecting race conditions, even for software that's intended to be run later on non-TSX systems. Is this correct? If so, which of the above software compilers/interpreters/developement environments supports this?

Finally, along with TSX, I've seen mention of something called speculative multithreading (SpMT). It seems to run both versions of a branch, speculatively, each in its own thread, for some period of time. Is this something TSX will make possible/easier? Would it be possible for existing software to take advantage of this to run faster? Would recompiling be necessary?

And is there anything else TSX is good for that I missed?
 

Cogman

Lifer
Sep 19, 2000
10,286
147
106
At one point, java was rumored to be getting transactional memory support in V8, that has since died off.

TSX will be faster than locking is most cases, so it is possible that the benefit you are hearing about has come from replacing locks with TSX instructions.