Idahowalker
Posts: 300
Joined: Wed Jan 03, 2018 5:43 pm

Threading, a question or two

Tue Mar 13, 2018 10:09 pm

I want to spawn a thread to do one function and when that function is done the thread should be done. What I have read about Python threads is the the thread keeps on running, is that correct? Or is when the function is done, in a thread, the thread is done?

I am looking to run a shared memory space thread which will have access to a single variable to read and change the variables value. Sending an email.

So basically, the process to the email is called, the email access the body of the message to be sent, the email is sent, and the thread ends.

Many examples abound on doing in process threading, I am just not clear on clean up when the function is done.
Being a programmer: She says go to the store get 1 bottle of milk, if they have eggs bring back 6. She gets mad cause I brought back 6 bottles of milk.

Idahowalker
Posts: 300
Joined: Wed Jan 03, 2018 5:43 pm

Re: Threading, a question or two

Wed Mar 14, 2018 2:07 am

Oi! I found the answer to my question.

One person, so far, took the time to write that when a function running in a thread is done the thread is done as well. I thought so but had to see it before I went with it. Now I am sending emails in a thread and do not have to waste so much time waiting whiles going through all that email protocol junk.
Being a programmer: She says go to the store get 1 bottle of milk, if they have eggs bring back 6. She gets mad cause I brought back 6 bottles of milk.

Return to “Python”

Who is online

Users browsing this forum: No registered users and 16 guests