nested threading

O

Omer Ihsan

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....:-|
 
A

Aahz

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 ([email protected]) <*> 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,491
Latest member
mohitk

Latest Threads

Top