[Gluster-devel] readdir() harmful in threaded code

Pranith Kumar Karampuri pkarampu at redhat.com
Sun Jul 24 02:16:13 UTC 2016


On Sat, Jul 23, 2016 at 8:02 PM, Emmanuel Dreyfus <manu at netbsd.org> wrote:

> Pranith Kumar Karampuri <pkarampu at redhat.com> wrote:
>
> > So should we do readdir() with external locks for everything instead?
>
> readdir() with a per-directory lock is safe. However, it may come with a
> performance hit in some scenarios, since two threads cannot read the
> same directory at once. But I am not sure it can happen in GlusterFS.
>
> I am a bit disturbed by readdir_r() being planned for deprecation. The
> Open Group does not say that, or I missed it:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html


I will wait for more people to comment on this. Let us see what they think
as well.


>
>
> --
> Emmanuel Dreyfus
> http://hcpnet.free.fr/pubz
> manu at netbsd.org
>



-- 
Pranith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160724/eb72c50f/attachment-0001.html>


More information about the Gluster-devel mailing list