Make a choice. Speculative stores are stores that (in some implementations) are not seen by other threads. Or they are not stores.hgm wrote:Speculative stores are stores. I don't see your point.syzygy wrote:I am talking about speculative stores. In your dictionary they have apparently been defined away. I suppose speculative execution does not exist, either.
Either way, the fact is that "speculative stores" are being discussed in hundreds of papers, so they do exist.
In the example we are dicussing, do you have difficulty with the idea that both threads commit in a synchronised manner, thereby corroborating each other?Indeed. If a speculation cannot be corroborated by non-speculative data it will have to aborted together with all its consequences. The papers do that. Your examples don't.Depends on the implementation. In some implementations writes are invisible to other threads until the transaction is committed (lazy versioning). In other implementations writes are visible before the transaction is committed (eager versioning). In that case the threads seeing those writes will have to be aborted if the writing transaction does not get committed.
This synchronisation clearly is a complicating factor compared to the schemes in the papers, but there is no inherent impossibility here.
No, you were talking about a "dependency cycle". There is no dependency cycle between T1 and T2.Well, that is exactly what I said, not? T2 cannot commit unless T1 commits. It must be sure that T1 commits before the other thread can use it (i.e. T2 can commit). You cannot use the data as long as it is speculative, and might have to be rolled back.Nope. If T1 writes to X and T2 reads from X, then T2 is dependent on T1 but not the other way around. No cyclic dependency. T2 can use the result, obviously, or it should not have seen it. T2 must be rolled back if T1 is.
T2 is using the data, albeit speculatively. There might be a T3 using T2's data.
Of course you can say that speculative execution is not doing anything, is not using anything, is not execution. You can define away speculative execution. But the fact is that, provided in the end things get committed, real work is being done by those speculative threads. I don't see the point in your word play.