On Mon, Aug 18, 2008 at 10:58 PM, tarun <tarundevnani@g mail.comwrote:
Does making it a class level instead of instance level variable not work?
--
Stand Fast,
tjg. [Timothy Grant]
Hello All,
>
I've a configuration.i ni file. This particular can be accessed by several
threads of my application. Each thread can read/write configuration
parameters from/to the configuration.i ni file. I am using threading (Rlock)
to lock the resource (configuration. ini file) while accessing it from any
thread. I use the file available at
http://www.voidspace.org.uk/python/configobj.html for read/write.
>
I did the following in one of my files:
>
import threading
class Synchronization :
def __init__(self):
self.mutex = threading.RLock ()
>
Now this I can create instances of the class Synchronization and use
acquire/release to work on the shared resource. But every thread would need
to import this class and hence each thread would create a separate instance
of the class. This means several lock variables. But I think we need a
global lock flag that is accessible across all the threads.
>
How do i do this?
>
Please let me know ASAP.
>
Thanks In Advance,
Tarun
--
>
>
I've a configuration.i ni file. This particular can be accessed by several
threads of my application. Each thread can read/write configuration
parameters from/to the configuration.i ni file. I am using threading (Rlock)
to lock the resource (configuration. ini file) while accessing it from any
thread. I use the file available at
http://www.voidspace.org.uk/python/configobj.html for read/write.
>
I did the following in one of my files:
>
import threading
class Synchronization :
def __init__(self):
self.mutex = threading.RLock ()
>
Now this I can create instances of the class Synchronization and use
acquire/release to work on the shared resource. But every thread would need
to import this class and hence each thread would create a separate instance
of the class. This means several lock variables. But I think we need a
global lock flag that is accessible across all the threads.
>
How do i do this?
>
Please let me know ASAP.
>
Thanks In Advance,
Tarun
--
>
--
Stand Fast,
tjg. [Timothy Grant]