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

Contract with threaded method #2830

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Delja
Copy link
Contributor

@Delja Delja commented Aug 2, 2020

This pr makes it possible to prevent that contracts in different threads to interfere with the same flag to know if a contract evaluation should be performed.

Instead of using a flag contained in the Sys instance, we are now using a new AST node which:

  • During compilation it will be transformed into an if with for condition the evaluation of a variable whose value is specific to each threat ( in_assertion). Note we used the keyword __thread.

  • During the interpretation the node will be evaluated in the same way as an if (without an else block) with for condition the value of the attribute in_assertion defined in the interpreter.

Note: When you evaluate a contract, the evaluation is performed in the same thread as the caller. (only the method will be executed in a new thread)

@Delja Delja force-pushed the contract_multy_thread branch 4 times, most recently from 8ee9b86 to a0ba0cc Compare August 4, 2020 15:29
@Delja Delja force-pushed the contract_multy_thread branch 2 times, most recently from a8b205d to 823f0ed Compare August 16, 2020 17:00
@Delja Delja requested a review from privat August 16, 2020 21:00
@Delja Delja force-pushed the contract_multy_thread branch from 823f0ed to 4375990 Compare August 20, 2020 20:45
@privat privat closed this Aug 16, 2024
@privat privat reopened this Aug 16, 2024
Copy link

Test Results

    67 files     338 suites   17m 34s ⏱️
14 192 tests 13 648 ✅ 544 💤 0 ❌
14 588 runs  14 028 ✅ 560 💤 0 ❌

Results for commit 4375990.

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

Successfully merging this pull request may close these issues.

2 participants