How to create two process | Sololearn: Learn to code for FREE!


How to create two process

Hi Refer code I prepared for kind of chat messages I need to create two different process for player 1 and player 2. Can anyone please guide me on this? I am very new to processes. Thanks in advance!

4/29/2022 4:14:34 AM

Ketan Lalcheta

6 Answers

New Answer


True In that case youlll need to fork a new process


FYI When you fork a new procees variables changed in one dont change the variables in the other. They are two seprate processes after the fork. As if you ran the program on two terminals. On the other hand threading stays in one process. And you have to keep in mind what variables each thread is manipulating.


Im not sure but this video might help And for your game id recommend doing socket programming with python Example as to why 41:20-45:45 Keep in mind he is hardcooding the client messages But you can have each client type in something before sending it


Spoke too soon : Heres an example of threading working


Not sure but I don't think so... Different threads does not mean different process... Right ? Is my understanding correct ? Something to start new process is I never used.. Sometime , although less, but I do have used threads


Unfortunately I can't use fork as I am not on Linux... Any counterpart for windows ?