| Anonymous | Login | Signup for a new account | 2013-05-20 20:28 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 | |||
| 0000024 | OCaml | OCaml general | public | 2000-01-14 22:29 | 2000-02-07 15:03 | |||
| 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 | 0000024: thread-safety and I/O | |||||||
| Description | Full_Name: Gerd Stolpmann Version: 2.04 -with-pthread OS: Linux-2.2.13 with glibc-6.1 Submission from: master.proxy.ision.net (195.180.208.40) The following piece of code "q.ml", compiled with ocamlopt -o q -thread unix.cmxa threads.cmxa q.ml -cclib -lunix -cclib -lthreadsnat -cclib -pthread does not work if "n" is less than 1024. "q.data" is a file with contents "abcd\n". If it works correctly, the program must not produce any output. let n = 1023 in for i = 1 to 50 do (* 50 threads doing I/O *) let id = Thread.create (fun () -> for j = 1 to 100 do (* read the file 100 times *) let ch = open_in "q.data" in let u = let s = String.create n in ignore(input ch s 0 5); String.sub s 0 5 in close_in ch; if u <> "abcd\n" then let v = Printf.sprintf "i=%d j=%d s=%s\n" i j u in prerr_endline v; done; ) () in l := id :: !l done; List.iter (fun id -> Thread.join id) !l ;; | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0000296) administrator (administrator) 2000-02-07 15:03 |
Fixed in 3.00 (see PR#25) |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:13 | administrator | New Issue | |
| Copyright © 2000 - 2011 MantisBT Group |