[Ilugc] Regarding Python File Function

  • From: prashmohan@xxxxxxxxx (Prashanth Mohan)
  • Date: Fri Apr 27 15:16:20 2007

Chakkaradeep C C wrote:

On 4/27/07, R. Ramkumar <andyetitmoves@xxxxxxxxx> wrote:

This is insecure, as it has a race condition... Make sure the race
condition doesn't affect the program.


can you please explain, it would be helpful for me



P1                              P2
---                             ---
check for file                  sleep
above call returns false        sleep
sleep                           create file
create file (truncates)         sleep



-- 
Prashanth Mohan
http://prashblog.com

Other related posts: