-3

I tried fcntl record lock work in multithreads on linux. But it seems fcntl record lock doesn't work? Can fcntl record lock work in multithreads?

yafeng
  • 1
  • 1

1 Answers1

0

fcntl() locking is process-based. It provides for any thread of one process to set a lock on a file or part of one that prevents all threads of all other processes from acquiring conflicting locks. But it does not discriminate among different threads of the same process, so it cannot be used to support one thread excluding other threads of the same process.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157