a couple windows. Notice that when one <code>lockdemo</code> has a read lock, other instances of the program can get their own read locks with no problem. It’s only when a write lock is obtained that other processes can’t get a lock of any kind.</p>
<p>Another thing to notice is that you can’t get a write lock if there are any read locks on the same region of the file. The process waiting to get the write lock will wait until all the read locks are cleared. One upshot of this is that you can keep pili