[Seaside] Serving files -- correction

mmille10 at comcast.net mmille10 at comcast.net
Sat Oct 14 09:17:20 UTC 2006

-------------- Original message -------------- 
From: Jason Johnson <jbjohns at libsource.com> 

> David Shaffer wrote: 
> > tim Rowledge wrote: 
> >> 
> >> On 11-Oct-06, at 5:10 AM, David Shaffer wrote: 
> >> 
> >> Assuming I understand 'tread safe' in same way that you mean it, that 
> >> isn't strictly correct. The problem is that the squeak model use 
> >> separate positioning and read/writing calls. Thus is is quite 
> >> possible (been there....) to have two processes referring to the same 
> >> file and get 
> >> procA -> position: a 
> >> procB -> position: b 
> >> procA -> read from position (which I thought was a!) 
> >> boom. 
> >> 
> > I thought my meaning was the obvious one but now that I hear yours I'd 
> > agree that I was wrong. So...(let's hope the second try is a charm) 
> > 
> > Just a point of clarification: file I/O on a single Stream is not 
> > thread safe 
> I know of no languages that are. If two processes are sharing the same 
> data structure, then that will always have race conditions, unless every 
> access is blocked by a Mutex (which, of course, you don't want). 

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20061014/9891704f/attachment.htm

More information about the Seaside mailing list