3 ms·
Threads can be implemented as a library if the compiler and hardware don't perform any reordering of memory instructions.
by amelius 8y ago
Threads can be implemented as a library if the compiler and hardware don't perform any reordering of memory instructions.
- gpderetta 8y agoAtomicity and visibility are also an issue.
- amelius 8y agoYou still need synchronization instructions, but you can handle them through library function calls (i.e., you don't need to change the language specification for them).
- jzoch 8y agoThats what C++ thought too :). I believe the whole point of this paper is to argue your point (minus the whole lets simplify the compiler so that it cant do a ton of optimizations part since nobody would agree to that)
- deleted 8y ago[deleted]
- amelius 8y agoWell, in my book correctness comes first. So if you want to do multi-threading without changing the language, then you'll have to fix the compiler (to make it preserve correctness).
- twanvl 8y agoIt is hard to define what "ordering of memory operations" actually means if there is no memory model that takes multi-threading into account. Most styles of formal semantics will allow operations to be reordered as long as the final state is the same.