I am making a python script that should do 3 things at a time. What is a good way to achieve this, just like what I heard about GIL, I'm not so inclined to use threads anymore. 2 of the things that the script needs to execute will be very active, they will have a lot of work, and then I need the third message to be sent to the user through the socket when he asks (this will be a tiny server) about the status of the other 2 processes.
Now my question is, what would be a good way to achieve this? I do not want to have three different scripts, and also because GIL uses threads. I think I will not get more performance, and I will make things worse. Is there fork () for python, like in C, so from my processes script fork 2 that will do their job and tell the user from the main process? And how can I communicate with forked processes using the main process?
LE:: more precisely, 1thread should receive emails from the imap server and store them in the database, another stream should receive messages from db that should be sent, and then send them and the main stream should be a tiny http server that just accepts one URL and will show the status of these two streams in json format. Also have oK themes? will the work be done simultaneously or due to gil, will there be performance problems?
source share