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

Thread identification #212

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Thread identification #212

merged 4 commits into from
Jul 8, 2024

Conversation

l-kent
Copy link
Contributor

@l-kent l-kent commented May 30, 2024

Splits threads into separate boogie output files. Currently only works for pthreads (support for other thread libraries can be added later)

-t flag enables this functionality and requires the --analyse flag to be used alongside it.

…, improve handling of external library calls
@ailrst
Copy link
Contributor

ailrst commented May 31, 2024

Can you check in the C source for the two examples please

@l-kent
Copy link
Contributor Author

l-kent commented May 31, 2024

It already exists for 'basic_assign_pthread' and never existed for the 'pthread' example (someone else committed it but without the source) which is why I removed it.

@ailrst
Copy link
Contributor

ailrst commented May 31, 2024

Oh ok my mistake, I thought it was a newly added example

@l-kent
Copy link
Contributor Author

l-kent commented Jun 7, 2024

This obviously needs to wait for #204 to be merged in.

@l-kent l-kent requested a review from ailrst June 18, 2024 00:11
Copy link
Contributor

@ailrst ailrst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks fine, I left some comments for things to clean up.

case _ =>
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be written in a functional style (since we have the iterator defined on the IR program you can do program.collect{}) but its still pretty interpret-able as is.

src/main/scala/util/RunUtils.scala Show resolved Hide resolved
src/main/scala/Main.scala Outdated Show resolved Hide resolved
if (threadTargets.size > 1) {
// currently can't handle case where the thread created is ambiguous
throw Exception("can't handle thread creation with more than one possible target")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all we currently do is output extra programs to verify we can probably just attempt to resolve all the targets and add them as separate threads.

@@ -78,9 +85,9 @@ object Main {
val q = BASILConfig(
loading = ILLoadingConfig(conf.inputFileName, conf.relfFileName, conf.specFileName, conf.dumpIL, conf.mainProcedureName, conf.procedureDepth),
runInterpret = conf.interpret.value,
staticAnalysis = if conf.analyse.value then Some(StaticAnalysisConfig(conf.dumpIL, conf.analysisResults, conf.analysisResultsDot)) else None,
staticAnalysis = if conf.analyse.value then Some(StaticAnalysisConfig(conf.dumpIL, conf.analysisResults, conf.analysisResultsDot, conf.threadSplit.value)) else None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have --threads imply --analyse

@l-kent l-kent merged commit d6d85c5 into main Jul 8, 2024
2 checks passed
@l-kent l-kent deleted the thread-identification branch July 16, 2024 00:54
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

Successfully merging this pull request may close these issues.

None yet

2 participants