<html><body>
<DIV>-------------- Original message -------------- <BR>From: Jason Johnson <jbjohns@libsource.com> <BR><BR>> David Shaffer wrote: <BR>> > tim Rowledge wrote: <BR>> >> <BR>> >> On 11-Oct-06, at 5:10 AM, David Shaffer wrote: <BR>> >> <BR>> >> Assuming I understand 'tread safe' in same way that you mean it, that <BR>> >> isn't strictly correct. The problem is that the squeak model use <BR>> >> separate positioning and read/writing calls. Thus is is quite <BR>> >> possible (been there....) to have two processes referring to the same <BR>> >> file and get <BR>> >> procA -> position: a <BR>> >> procB -> position: b <BR>> >> procA -> read from position (which I thought was a!) <BR>> >> boom. <BR>> >> <BR>> > I thought my meaning was the obvious one but now that I hear yours I'd <BR>> > agree that I was wrong. So...(let's hope the second
try is a charm) <BR>> > <BR>> > Just a point of clarification: file I/O on a single Stream is not <BR>> > thread safe <BR>> <BR>> I know of no languages that are. If two processes are sharing the same <BR>> data structure, then that will always have race conditions, unless every <BR>> access is blocked by a Mutex (which, of course, you don't want). <BR></DIV>
<DIV>I think I misinterpreted this message the first time through. What David was saying is that positioning the stream to a certain location in the file doesn't help, because the other thread may come along and position it somewhere else. I don't know enough to say whether the read operation also repositions the "file pointer" in the stream, so to speak. Anyway, like I was saying in my last message, it sounds like an intermediary architecture might be necessary to make different threads play nice together with the same file.</DIV>
<DIV> </DIV>
<DIV>---Mark</DIV>
<DIV> </DIV></body></html>