Simple Concurrent Object-Oriented Programming
Simple Concurrent Object-Oriented Programming
Programming
Nati Fuks
SCOOP Introduction
Generator
SCOOP vs Java
PRODUCER-CONSUMER example
SCOOP Semantics
SCOOP platform-independent
.NET
Eiffel + Framework POSIX …
Threads
2. This work
Design By Contract
What do we achieve?
Concurrent programs using SCOOP
Advantages
Pure Eiffel
Independence
Target code is cross-platform
b: separate BUFFER
p: PRODUCER -- declared separate
c: CONSUMER -- declared separate
make is
-- Creation procedure.
do
create b.make
create p.make(b)
create c.make(b)
end
end
put (x:INTEGER) is
require count <= 3
do q.put(x)
ensure count = old count + 1 and q.has (x)
end
remove is
require count > 0
do q.remove
ensure count = old count - 1
end
…
end
feature feature
request_pended: INTEGER_REF
requests_pended_mutex:MUTEX
b_mutex.lock
create b.make create b.make
b_mutex.unlock
p.launch
set_feature_to_do ([Current,
"KEEP_PRODUCING_ROUTINE"])
requests_pended_mutex.lock
requests_pended.copy
(requests_pended-1)
requests_pended_mutex.unlock
join_all
end end
Department of Computer Science, York University
Contributions