[Haskell-cafe] Race condition possible?
bos at serpentine.com
Sat Feb 14 23:38:39 EST 2009
2009/2/14 Peter Verswyvelen <bugfact at gmail.com>
> If you have two streams of time/value pairs - using MVars as write-once
> sampling variables - and both streams are fed from another thread (e.g.
> timers firing), and you want to merge these two streams into a single stream
> with monotonic time stamps, then you want to be able to check if at time t
> an occurrence exists in a stream.
What you want to do isn't actually achievable on multi-processor machines
without some form of mutual exclusion. Time on different cores does not
progress monotonically, and you'll pay an enormous performance penalty to do
what you want to do (the nature of which is somewhat unclear).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe