Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Tesson
BSML-Multicore
Commits
b4328d44
Commit
b4328d44
authored
Feb 08, 2018
by
Julien Tesson
Browse files
bugfix : sync() was locked because main redeclare a different global counter
parent
59cdc74a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/0.5.4-multicore/src/shared/workers/shared.ml
View file @
b4328d44
...
...
@@ -76,6 +76,9 @@ Bsmlsig.BSML
(** *** Syncronisation tools *)
(* ********************************* *)
(** Global counter incremented by workers to let the main thread know that they have reached the next sync point.
When all worker are ready, the last thread reset it to zero.
*)
let
global_counter
=
Atomic
.
make
0
...
...
@@ -206,10 +209,6 @@ Bsmlsig.BSML
);
notify_all
()
(** Global counter incremented by workers to let the main thread know that they have reached the next sync point.
When all worker are ready, the main thread reset it to zero.
*)
let
global_counter
=
Atomic
.
make
0
(** Legacy code, should not be used - Synchronisation with all active threads *)
let
join_all
()
=
Array
.
iter
(
fun
th
->
Domain
.
join
th
)
!
threads
...
...
@@ -236,7 +235,7 @@ Bsmlsig.BSML
let
sync
()
=
(* adding Sync to the action list *)
add
Sync
;
(* notifying all threads they have awai
n
ting work *)
(* notifying all threads they have awaiting work *)
notify_all
()
;
(* waiting until all threads said they finshed *)
commit_one_and_wait
global_counter
notify_all_with_main_but
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment