1. The locking mechanism works because link and unlink are atomic operations, i.e. cannot be interrupted. 2. To prevent two processes from both creating the same file, each process can do the following: 2.a create a file the name of which is unique, e.g. contains the id of the process 2.b use link as before to create a link to the file just created, but use the same name for the link 2.c if 2.b succeeds go ahead and create the desired file