Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: re-certification for each instruction step #2

Open
jeehoonkang opened this issue Jan 26, 2017 · 1 comment
Open

Proposal: re-certification for each instruction step #2

jeehoonkang opened this issue Jan 26, 2017 · 1 comment

Comments

@jeehoonkang
Copy link
Contributor

jeehoonkang commented Jan 26, 2017

It is a "call for discussion" for the matter of re-certification.

Currently we allow a thread to take instruction steps as many as it wants, and its promises are re-certified only after all the instruction steps are executed. It basically allows more behaviors, effectively validating more compiler optimizations (e.g. merging a write and a update).

Some people complained that it looks bad, and now we have quite a concrete reason why we don't want it. Consider the following code snippet:

lock(); // implemented w/ acquire CAS to location "l"
x = 1;
unlock(); // implemented as release write to "l"

Here, we want to do some modular reasoning and conclude that x = 1 cannot be promised before the lock is acquired. However, actually it can be, provided that unlock() is called right before lock(), as in the certification you can lock() "l" that is just released by unlock(). This is basically due to the fact that we re-certify the promises only at the end of a tread step, but not every instruction step, e.g. especially right before lock():

// [x = 1] can be promised
unlock();
// not required to re-certify promises here
lock();
x = 1;
unlock();

I believe the benefit of allowing these kind of reasoning is much bigger than the cost of losing some compiler optimizations, which are anyway not performed in the mainstream compilers.

So I propose to revise the promising semantics in such a way that a thread step is really a single instruction step, and the promises are re-certified for each instruction step.

We may need to adjust simulation relations for compiler optimizations, but it should not be a big deal AFAICT. We will see.

@jeehoonkang jeehoonkang changed the title Proposal: re-certify for each instruction step Proposal: re-certification for each instruction step Jan 26, 2017
@vafeiadis
Copy link
Contributor

vafeiadis commented Jan 26, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants