Prev: Advanced Python Programming Oxford Lectures [was: Re: *Advanced* Python book?]
Next: ANN: ActivePython 2.6.5.12 and 3.1.2.3 are now available
From: Omer Ihsan on 25 Mar 2010 11:23 is there anything as "nested threading"....that is, call a thread from within a thread. in this case how will thread locking take place. for example initially there were two functions that were called using threading.Thread. these wont get unlocked unless both of them are done with whatever they need to do. if say function 2 calls another thread. then what?? inquisitive....:-|
From: Aahz on 9 Apr 2010 19:38
In article <4566e767-768f-4399-8a6b-5530ec90b03c(a)a37g2000prd.googlegroups.com>, Omer Ihsan <omrihsan(a)gmail.com> wrote: > >is there anything as "nested threading"....that is, call a thread from >within a thread. >in this case how will thread locking take place. > >for example initially there were two functions that were called using >threading.Thread. these wont get unlocked unless both of them are done >with whatever they need to do. if say function 2 calls another thread. >then what?? You need to do the locking explicitly. There's really no such thing as a nested thread in Python -- it's all a "flat namespace". However, trying to nest threads conceptually is likely to get you into deadlock issues. You are more likely to make things work if you just start all threads in parallel. -- Aahz (aahz(a)pythoncraft.com) <*> http://www.pythoncraft.com/ "...string iteration isn't about treating strings as sequences of strings, it's about treating strings as sequences of characters. The fact that characters are also strings is the reason we have problems, but characters are strings for other good reasons." --Aahz |