IIRC creating a directory is atomic in most environments.
On Sunday, February 9, 2014 2:39:51 AM UTC-8, Asaf Las wrote:
> Hi
>
>
>
> Which one is most recommended to use for mutex alike locking to
>
> achieve atomic access to single resource:
>
>
>
> - fcntl.lockf
>
> - os.open() with O_
On 2014-02-09, Asaf Las wrote:
> Hi
>
> Which one is most recommended to use for mutex alike locking to
> achieve atomic access to single resource:
>
> - fcntl.lockf
> - os.open() with O_SHLOCK and O_EXLOCK
> - https://pypi.python.org/pypi/lockfile/0.9.1
> - https://pypi.python.org/pypi/zc.lock
On Mon, Feb 10, 2014 at 1:45 AM, Roy Smith wrote:
> In article ,
> Skip Montanaro wrote:
>
>> As the author of lockfile, I can tell you it only implements advisory
>> locking. All programs needing to access the locked resources must
>> cooperate.
>
> This is true of all mutexes, no?
>
Not quite
Hi
Thanks for replies. It would be good to have blocking implementation.
I have to check fcntl if it works in blocking mdoe on CentOS.
Meanwhile there is Posix Semaphore made for Python:
http://semanchuk.com/philip/posix_ipc/
will try it as well.
/Asaf
--
https://mail.python.org/mailman/li
Asaf Las :
> Which one is most recommended to use for mutex alike locking to
> achieve atomic access to single resource:
>
> - fcntl.lockf
I recommend fcntl.flock:
#!/usr/bin/python3
import sys, fcntl, time
with open("te
On Sun, Feb 9, 2014 at 8:45 AM, Roy Smith wrote:
> This is true of all mutexes, no?
Hmmm... You might well be right. I thought that use of the O_EXLOCK
flag in the open(2) system call would prevent other processes from
opening the file, but (at least on my Mac) it just blocks until the
first proc
In article ,
Skip Montanaro wrote:
> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - os.open() with O_SHLOCK and O_EXLOCK
> > - https://pypi.python.org/pypi/lockfile/0.9.1
> > - https://pypi.python.org/py
On Sunday, February 9, 2014 1:00:39 PM UTC+2, Skip Montanaro wrote:
> > Which one is most recommended to use for mutex alike locking to
> > achieve atomic access to single resource:
> >
> > - fcntl.lockf
> > - os.open() with O_SHLOCK and O_EXLOCK
> > - https://pypi.python.org/pypi/lockfile/0.9.1
>
Forget to mentioned - CentOS 6.5 Python v3.3.
--
https://mail.python.org/mailman/listinfo/python-list
> Which one is most recommended to use for mutex alike locking to
> achieve atomic access to single resource:
>
> - fcntl.lockf
> - os.open() with O_SHLOCK and O_EXLOCK
> - https://pypi.python.org/pypi/lockfile/0.9.1
> - https://pypi.python.org/pypi/zc.lockfile/1.1.0
> - any other ?
As the author
Hi
Which one is most recommended to use for mutex alike locking to
achieve atomic access to single resource:
- fcntl.lockf
- os.open() with O_SHLOCK and O_EXLOCK
- https://pypi.python.org/pypi/lockfile/0.9.1
- https://pypi.python.org/pypi/zc.lockfile/1.1.0
- any other ?
Thanks
/Asaf
--
htt
11 matches
Mail list logo