You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 22 Reporter: administrator Status: closed (set by @xavierleroy on 2006-06-17T09:54:06Z) Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Dans l'exemple suivant, le programme utilisant les threads est
complètement bloqué par celui ne les utilisant pas...
-- Jérôme
mistral-jerome:/tmp > cat > essai.ml
let _ = let x = ref 0. in for i = 0 to 10000000 do x := !x *. 1.1 done
mistral-jerome:/tmp > ocamlc -o essai essai.ml
mistral-jerome:/tmp > cat essai2.ml
let _ = Thread.create
let _ = let x = ref 0. in for i = 0 to 10000000 do x := !x *. 1.1 done
mistral-jerome:/tmp > ocamlc -custom -thread -o essai2 unix.cma
threads.cma essai2.ml -cclib "-lunix -lthreads -lpthread"
mistral-jerome:~/tmp > time ./essai & time ./essai2
[1] 1292
./essai 13,21s user 0,01s system 98% cpu 13,470 total
[1] + done time ./essai
./essai2 12,97s user 0,02s system 49% cpu 26,415 total
[Damien Doligez:]
Pas reproductible sur Tru64. Feature de Linux Threads ?
[Jerome Vouillon:]
Voilà ce qui se passe :
Il y a un thread qui signale toutes les 50ms au thread s'exécutant à
ce moment là de laisser la place à un autre thread. Ce thread appelle
pour celà sched_yield. Comme il y a un autre processus qui peut
s'exécuter le thread ne reprend la main qu'après plus de 50ms... et
rappelle immédiatement sched_yield, car le thread horloge s'est
exécuté entre temps. Le thread principal n'a donc jamais l'occasion de
s'exécuter.
-- Jérôme
The text was updated successfully, but these errors were encountered:
Original bug ID: 22
Reporter: administrator
Status: closed (set by @xavierleroy on 2006-06-17T09:54:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Jerome Vouillon
Version:
OS:
Submission from: estephe.inria.fr (128.93.11.95)
Submitted by: xleroy
Dans l'exemple suivant, le programme utilisant les threads est
complètement bloqué par celui ne les utilisant pas...
-- Jérôme
mistral-jerome:
/tmp > cat > essai.ml/tmp > ocamlc -o essai essai.mllet _ = let x = ref 0. in for i = 0 to 10000000 do x := !x *. 1.1 done
mistral-jerome:
mistral-jerome:
/tmp > cat essai2.ml/tmp > ocamlc -custom -thread -o essai2 unix.cmalet _ = Thread.create
let _ = let x = ref 0. in for i = 0 to 10000000 do x := !x *. 1.1 done
mistral-jerome:
threads.cma essai2.ml -cclib "-lunix -lthreads -lpthread"
mistral-jerome:~/tmp > time ./essai & time ./essai2
[1] 1292
./essai 13,21s user 0,01s system 98% cpu 13,470 total
[1] + done time ./essai
./essai2 12,97s user 0,02s system 49% cpu 26,415 total
[Damien Doligez:]
Pas reproductible sur Tru64. Feature de Linux Threads ?
[Jerome Vouillon:]
Voilà ce qui se passe :
Il y a un thread qui signale toutes les 50ms au thread s'exécutant à
ce moment là de laisser la place à un autre thread. Ce thread appelle
pour celà sched_yield. Comme il y a un autre processus qui peut
s'exécuter le thread ne reprend la main qu'après plus de 50ms... et
rappelle immédiatement sched_yield, car le thread horloge s'est
exécuté entre temps. Le thread principal n'a donc jamais l'occasion de
s'exécuter.
-- Jérôme
The text was updated successfully, but these errors were encountered: