The original tests trigger some limits and fail on kfreebsd-i386 with
uncaught exception Sys_error("Thread.create: Resource temporarily
unavailable").
Gbp-Pq: Name 0013-Tune-resource-usage-of-some-tests.patch
in Thread.create (integers 2) ch;
print_primes ch max;;
-let _ = go 500
+let _ = go 50
;;
41
43
47
-53
-59
-61
-67
-71
-73
-79
-83
-89
-97
-101
-103
-107
-109
-113
-127
-131
-137
-139
-149
-151
-157
-163
-167
-173
-179
-181
-191
-193
-197
-199
-211
-223
-227
-229
-233
-239
-241
-251
-257
-263
-269
-271
-277
-281
-283
-293
-307
-311
-313
-317
-331
-337
-347
-349
-353
-359
-367
-373
-379
-383
-389
-397
-401
-409
-419
-421
-431
-433
-439
-443
-449
-457
-461
-463
-467
-479
-487
-491
-499
let main _ =
Thread.create sieve premiers;
while true do
- for i = 1 to 100 do
+ for i = 1 to 30 do
let n = Event.sync (Event.receive premiers) in
print_int n; print_newline()
done;
101
103
107
-109
-113
-127
-131
-137
-139
-149
-151
-157
-163
-167
-173
-179
-181
-191
-193
-197
-199
-211
-223
-227
-229
-233
-239
-241
-251
-257
-263
-269
-271
-277
-281
-283
-293
-307
-311
-313
-317
-331
-337
-347
-349
-353
-359
-367
-373
-379
-383
-389
-397
-401
-409
-419
-421
-431
-433
-439
-443
-449
-457
-461
-463
-467
-479
-487
-491
-499
-503
-509
-521
done
let main() =
- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
+ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
let conds = Array.create nprocs (Condition.create()) in
for i = 1 to nprocs - 1 do conds.(i) <- Condition.create() done;
done
let main() =
- let nprocs = try int_of_string Sys.argv.(1) with _ -> 100 in
+ let nprocs = try int_of_string Sys.argv.(1) with _ -> 30 in
let iter = try int_of_string Sys.argv.(2) with _ -> 1000 in
let ins = Array.create nprocs Unix.stdin in
let outs = Array.create nprocs Unix.stdout in