[geeks] Solaris losing-writers question

Kurt Huhn kurt at k-huhn.com
Fri Aug 12 23:23:34 CDT 2005


On Aug 13, 2005, at 12:05 AM, Patrick Giagnocavo 717-201-3366 wrote:

> Here is my situation and my question:
>
> Situation:  I am doing a small, non-PHP website.  I want to put 
> comments on the bottom of the page (at least, some pages).  I will be 
> doing this by writing to a flat file (basically appending to the end 
> of the comments file for each page, so that I can just include the 
> file into the end of the html without having to parse it).
>
> Question:  assume that 2 comments are made to the same pages at the 
> same time, by two different processes (remember that Apache will run 
> things in different processes so we can't do serialized requests 
> easily from within the code).  So the comments are each being appended 
> to the same file.
>
> Does one of the writers lose (not ending with the data being 
> recorded)?  Or does each writer write data into the file, but there 
> are no guarantees which comes first?
>

The chances of an append being done at *the exact same time* are pretty 
much nil.  IMO, not enough to get worried about.

--
Kurt Huhn         "A rebel I came, and I'll die just the same
kurt at k-huhn.com    On the cold winds of night you will find me"
                                        --Seven Nations



More information about the geeks mailing list