that was exactly my point ... I.e. if between two lines the "Haskell thread-of-execution" is interrupted ... and another thread/process ... .deletes the file then 2nd "line" of code would cause an exception to be thrown ... i.e. because of non-existence .. . Brandon, aren't we saying the same thing ... if so, forgive, my English .. :-) Vasya On Sat, Jul 12, 2014 at 7:02 PM, Brandon Allbery <allbery.b@gmail.com> wrote:
On Sat, Jul 12, 2014 at 7:54 PM, Vasili I. Galchin <vigalchin@gmail.com> wrote:
-- these two lines are non-thread safe .. yes?? to be thread-safe the above line and the following line would have to be together atomic ....
Not even then would it really be safe; it should trap the exception from readFile failing, instead of checking existence in a separate step.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net