Re: Noob thread lock question

2009-12-03 Thread Lie Ryan
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.

Re: Noob thread lock question

2009-12-03 Thread Astley Le Jasper
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)

Re: Noob thread lock question

2009-12-03 Thread Lie Ryan
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

Re: Noob thread lock question

2009-12-03 Thread Astley Le Jasper
Cheers for the responses. ALJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob thread lock question

2009-12-02 Thread John Nagle
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

Re: Noob thread lock question

2009-12-02 Thread Diez B. Roggisch
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

Noob thread lock question

2009-12-02 Thread Astley Le Jasper
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