in reply to Re (tilly) 2: flock - lordy me....
in thread flock - lordy me....
This is mostly a question. My impression is that flushing your buffers doesn't mean that the data has been written to the storage medium. But it does mean that the data is visible to other processes. So if another process goes to run after you've flushed your buffers, that data may not be on the storage medium but the other process should end up reading your data from the OS cache.
So you can still have a problem if, for example, the power fails after you get your sequence number. But delaying the unlocking doesn't help that case anyway.
I just noticed that merlyn made a good point about the danger of your read-cache being stale, but I don't think that applies in this particular case.
So my impression is that the explicit unlock isn't actually a problem in this specific case. I agree that it is a good thing to avoid as a general principle.
So my question is "Am I missing something?" I don't want to detract from the good points made. But I'm hoping for validation or specific refutation of my understanding here.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tilly) : Can't find it :-(
by tilly (Archbishop) on Jan 17, 2001 at 00:12 UTC | |
by tye (Sage) on Jan 17, 2001 at 00:45 UTC | |
by tilly (Archbishop) on Jan 17, 2001 at 01:41 UTC |