Ian Kelly wrote:
> As long as there's not *also* some other external process that needs
> to access the file occasionally. :-)
Then there is multiprocessing.Lock :)
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 31, 2015 at 1:59 PM, Christian Gollwitzer wrote:
> Am 31.03.15 um 21:17 schrieb Ian Kelly:
>> flock locks are per-process; they won't help for synchronizing access
>> between competing threads in the same process.
>>
>
> Ok. But if it is really all in one process, then a classical mute
Am 31.03.15 um 21:17 schrieb Ian Kelly:
On Tue, Mar 31, 2015 at 12:58 PM, Christian Gollwitzer wrote:
Am 31.03.15 um 16:50 schrieb Ervin Hegedüs:
there is an app, written in Python, which stores few bytes of
datas in a single file. The application uses threads. Every
thread can modify the fil
On Tue, Mar 31, 2015 at 12:58 PM, Christian Gollwitzer wrote:
> Am 31.03.15 um 16:50 schrieb Ervin Hegedüs:
>>
>> there is an app, written in Python, which stores few bytes of
>> datas in a single file. The application uses threads. Every
>> thread can modify the file, but only one at a time. I'm
Am 31.03.15 um 16:50 schrieb Ervin Hegedüs:
there is an app, written in Python, which stores few bytes of
datas in a single file. The application uses threads. Every
thread can modify the file, but only one at a time. I'm using a
lock file to prevent the multiple access.
Here is the lock method:
Hi Matthew,
On Tue, Mar 31, 2015 at 11:50:06AM -0400, Matthew Ruffalo wrote:
> On 2015-03-31 10:50, Ervin Hegedüs wrote:
> > there is an app, written in Python, which stores few bytes of
> > datas in a single file. The application uses threads. Every
> > thread can modify the file, but only one at
On 2015-03-31 10:50, Ervin Hegedüs wrote:
> there is an app, written in Python, which stores few bytes of
> datas in a single file. The application uses threads. Every
> thread can modify the file, but only one at a time. I'm using a
> lock file to prevent the multiple access.
>
> ...
>
> How can I
Hi Skip,
On Tue, Mar 31, 2015 at 10:19:27AM -0500, Skip Montanaro wrote:
> > sorry - at the end of the function there is a close() method to a
> > file, after the thread passes the modifications:
> >
> > try:
> > os.remove(self.lockfile)
> > except:
> > syslog.syslog(syslog
> sorry - at the end of the function there is a close() method to a
> file, after the thread passes the modifications:
>
> try:
> os.remove(self.lockfile)
> except:
> syslog.syslog(syslog.LOG_DEBUG, "Sync error: " +
> str(sys.exc_info()[1]))
Hmmm... Still not seeing os.clo
Hi Skip,
thanks for the reply,
On Tue, Mar 31, 2015 at 09:55:57AM -0500, Skip Montanaro wrote:
> On Tue, Mar 31, 2015 at 9:50 AM, Ervin Hegedüs wrote:
> > After few weeks the process
> > reaches the number if max fd's.
> >
> > How can I prevent or avoid this issue? What's the correct way to
> >
On Tue, Mar 31, 2015 at 9:50 AM, Ervin Hegedüs wrote:
> After few weeks the process
> reaches the number if max fd's.
>
> How can I prevent or avoid this issue? What's the correct way to
> handle the lockfile in Python?
Ervin,
You need to close the files you open. I don't see that happening in
y
Hello,
there is an app, written in Python, which stores few bytes of
datas in a single file. The application uses threads. Every
thread can modify the file, but only one at a time. I'm using a
lock file to prevent the multiple access.
Here is the lock method:
while True:
try:
f
12 matches
Mail list logo