[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    Re: [fuse-devel] sshfs hangs with 100% CPU on macosx
From:       Anatol Pomozov <anatol.pomozov () gmail ! com>
Date:       2011-06-06 16:18:11
Message-ID: BANLkTin1Ps+VxbNf6MSDa3yd_N-Z9_ODow () mail ! gmail ! com
[Download RAW message or body]

Hi

On Mon, Jun 6, 2011 at 6:09 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> Please ignore my previous mail, I didn't read the whole thread.
>
> Anatol Pomozov <anatol.pomozov@gmail.com> writes:
>
>> On the related note. Are there any objections on using pthreads
>> synchronization instead of semaphores? pthreads seems more portable...
>>
>> Here is the patch that makes sshfs working on macosx.
>
>
> Well, your patch depends on undefined behavior.   Mutexes shall be
> unlocked by the *same thread* that locked it.
>
> The correct solution would be to implement it with a condition variable,
> and I'd rather not do that in the sshfs source, since it adds
> unnecessary complexity.

The MACfuse semaphores implementation comes from libsem
http://lists.debian.org/debian-devel/2004/08/msg00612.html that itself
a clone of Hurd semaphores implementation.

> After googling a bit looks like sem_* emulation is already done by the
> MacFUSE port and is exported in the "fuse_darwin.h" header.
And it what I am trying to avoid. Imagine your macosx application
successfully uses named semaphores, then you do "inlclude <fuse.h>"
and bang - now your app uses someone's else semaphores implementation.
I think that fuse library should not redefine semaphores
implementation and if an application (sshfs) wants to use "libsem"
implementation it should do it explicitly (e.g. by adding libsem to
compat/ folder).

Another option is to use portable named semaphores and replace
sem_init/sem_destroy with sem_open/sem_unlink. If this does not work
for you then I'll probably add libsem sources to sshfs port
https://github.com/fuse4x/sshfs

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic