- status changed from new to accepted
The docs say that in order to make disabling of nested assertions
thread-safe in multi-threaded programs, the library needs to use a global
lock. Sorry if I am talking nonsense now (I have no intuition of using DbC
in multi-threaded apps), but is it not possible to use thread_local storage
for this purpose? Is it possible that executing an assertion in one thread
would cause the execution of another (nested) assertion in another thread?
I'll think about it. Generally speaking, multi-threading needs to be
handled a level higher than contracts... [Meyer97] also explains how
concurrent programming might fail the contracts (and then he
introduces SCOOP as a solution but Eiffel didn't implement SCOOP until
later). I can provide more information on "contracts and concurrency"
(maybe in a separated email thread) if needed.
Add a small section somewhere explaining the issues with contracts and concurrency (see [Meyer97]).
Log in to post a comment.