Is the tcp request sent by a thread or a process?

for example, I have such a simple code block, the main function is to receive http requests through the flask application, then judge the validity, and then send the combed data to other modules using tcp. So should the class that sends tcp requests inherit threading.Thread or multiprocessing.Process? Currently, flask applications are hosted on the main process, and sending tcp information can be regarded as an IO operation. Because in addition to sending data using tcp, another tcp port is monitored to receive data.


use multithreading, generally speaking, io intensive use threads, compute intensive use multiprocess


should use celery to start asynchronous tasks


using process is not a waste of process scheduling and switching time, network IO makes process wait most of the time

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47b3b-44c64.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47b3b-44c64.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?