| Anonymous | Login | Signup for a new account | 2013-05-24 11:38 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0000022 | OCaml | OCaml general | public | 2000-01-13 10:50 | 2006-06-17 11:54 | |||
| Reporter | administrator | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | ||||||||
| Target Version | Fixed in Version | |||||||
| Summary | 0000022: Scheduling problem with Posix threads | |||||||
| 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 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 | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0003067) administrator (administrator) 2004-06-25 17:40 |
May be related to PR#2663 and PR#2714 |
|
(0003690) xleroy (administrator) 2006-06-17 11:54 |
Starting with 3.08, the thread library does more careful use of sched_yield(). The example given works OK in 3.09 under Linux 2.6. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:14 | administrator | New Issue | |
| 2006-06-17 11:54 | xleroy | Note Added: 0003690 | |
| 2006-06-17 11:54 | xleroy | Status | acknowledged => closed |
| 2006-06-17 11:54 | xleroy | Resolution | unable to reproduce => fixed |
| 2006-06-17 11:54 | xleroy | Description Updated | |
| Copyright © 2000 - 2011 MantisBT Group |