lkml.org 
[lkml]   [2003]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fcntl file locking and pthreads
> Mikhail Kruk wrote:
> > on 2.4 kernels fcntl-based file locking does not work with
> > clone-based threads as expected (by me): two threads of the same process
> > can acquire exclusive lock on a file at the same time.
> > flock()-based locks work as expected, i.e. only one thread can have an
> > exclusive lock at a time.
>
> Is this true even when _not_ setting CLONE_FILES?

CLONE_FILES is an argument to clone(), I'm using pthreads and I don't
know if LinuxThreads implementation of pthreads gives me control of
how clone is called. Anyway, if I understand what CLONE_FILES does,
it should be given to clone, because threads do have to be able to share file
descriptors, probably. But not the locks!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site