THREADS language

38 views
Skip to first unread message

Marco Morazan

unread,
Jan 13, 2012, 2:20:58 PM1/13/12
to eo...@googlegroups.com
The implementation of the THREADS language as distributed with the
third edition of EOPL exhibits the behavior below in DrRacket. Why do
we see different behavior, both wrong, with different values for the
time slice? Is this a known bug? If so, is there a known fix
available?

Thanks,

Marco

Welcome to DrRacket, version 5.1.3 [3m].
Language: Determine language from source; memory limit: 128 MB.
> (run 2 "let x = 0
in let mut = mutex()
in let incr_x = proc (id) proc (dummy)
begin wait(mut);
set x = -(x, -1);
signal(mut)
end
in let d = begin
spawn((incr_x 100));
spawn((incr_x 200));
spawn((incr_x 300))
end
in x")
(num-val 1)

> (run 50 "let x = 0
in let mut = mutex()
in let incr_x = proc (id) proc (dummy)
begin wait(mut);
set x = -(x, -1);
signal(mut)
end
in let d = begin
spawn((incr_x 100));
spawn((incr_x 200));
spawn((incr_x 300))
end
in x")
(num-val 0)
>

--

Cheers,

Marco

Mitchell Wand

unread,
Jan 22, 2012, 11:16:51 PM1/22/12
to eo...@googlegroups.com
Maybe you need to wait for these threads to conclude?  --Mitch


--

Cheers,

Marco

--
You received this message because you are subscribed to the Google Groups "EOPL3" group.
To post to this group, send email to eo...@googlegroups.com.
To unsubscribe from this group, send email to eopl3+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/eopl3?hl=en.


Reply all
Reply to author
Forward
0 new messages