On 12/4/2009 1:20 AM, Astley Le Jasper wrote:
When you say don't forget about the GIL, what should I not be
forgetting? I'm using sqlite and the following:
I mean don't forget that when the GIL is locked, all threads (except the
current one, and threads waiting on I/O) will not be able to run.
When you say don't forget about the GIL, what should I not be
forgetting? I'm using sqlite and the following:
<<>
thread_lock = threading.RLock()
def db_execute(sql):
thread_lock.acquire()
try:
connection = sqlite3.connect(database_name)
On 12/3/2009 6:33 AM, Astley Le Jasper wrote:
I have a number of threads that write to a database. I have created a
thread lock, but my question is this:
- If one thread hits a lock, do a) all the other threads stop, or b)
just the ones that come to the same lock?
Just the ones the comes to th
Cheers for the responses.
ALJ
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
Astley Le Jasper schrieb:
I have a number of threads that write to a database. I have created a
thread lock, but my question is this:
- If one thread hits a lock, do a) all the other threads stop, or b)
just the ones that come to the same lock?
Only the ones coming the
Astley Le Jasper schrieb:
I have a number of threads that write to a database. I have created a
thread lock, but my question is this:
- If one thread hits a lock, do a) all the other threads stop, or b)
just the ones that come to the same lock?
Only the ones coming the the same lock.
- I pre
I have a number of threads that write to a database. I have created a
thread lock, but my question is this:
- If one thread hits a lock, do a) all the other threads stop, or b)
just the ones that come to the same lock?
- I presume that the answer is b. In which case do the threads stop
only if the
I'm sorry. My example code wasn't clear enough.
Please see the following:
exit_status = copy_first_match(foo, bar)
if exit_status == False:
if download_file(foo, bar) == True:
if zip_bool:
ziplock.acquire()
try:
Hi,
I have a question regarding locks in threads.
Following is the code example:
if download_file(foo, bar) == True:
if some condition:
do_something()
if zip_bool:
ziplock.acquire()
try: