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

Question for mapOfTHreadIds #1

Open
chakku000 opened this issue Jan 11, 2018 · 2 comments
Open

Question for mapOfTHreadIds #1

chakku000 opened this issue Jan 11, 2018 · 2 comments

Comments

@chakku000
Copy link

chakku000 commented Jan 11, 2018

I'm looking your code of PureHappensBefore/PureHappensBeforeImp.cpp.
And I have a question for your code.

How works `mapOfThreadIds'?
When I read line82, it looks map of : PIN's ID → System ID:.
https://github.com/onderkalaci/dyndatarace/blob/master/sources/PureHappensBefore/PureHappensBeforeImp.cpp#L82
But I read 84,85 line, this code looks like use mapOfThreadIds as map of : System ID → PIN's ID:.
https://github.com/onderkalaci/dyndatarace/blob/master/sources/PureHappensBefore/PureHappensBeforeImp.cpp#L84-L85

Is this mapOfThreadIds is used as map of :PIN's ID <--> System ID: Bidirectional transformation?

@onderkalaci
Copy link
Owner

I think it is map[ParentThreadId] = [List of Child ThreadIds] as declared here.

Note that a child thread could be the parent of other threads. (I can see that it's hard to follow. I wish I had better coding conventions/variable names.)

@chakku000
Copy link
Author

The type of mapThreadIds is map<THREADID,THREADID>, so I think mapOfThreadIds[ParentThradId] can't express [List of Child ThreadIds]. Because THREADID is not list type.

I think following.
PIN_GetParentTid() get System ID (not PIN'S ID), so in order to get Parent thread's PIN'S ID, there need transformation from System ID to PIN's ID. Is it right?

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