Skip to content
New issue

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

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

Already on GitHub? # 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?

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

No branches or pull requests

2 participants