
## Threads In The Software Languages

In order to explore the information which is sent in the network programming, it consistently controls the specified port and it runs in an infinite loop. Therefore, it is not possible for us to make any process (to transact) before the effective loop is not ended. Since we use an infinite loop, the transaction will never exist. Solution of the problem is putting the function, which controls the port, into another thread. This is called multithreading. Operating system divides/allocates the processor into two. One of the parts is for the main program, and the other one is for the endless loop. Thus, the functions within the program will not run in stages/steps, but in parallel.

## How We Used Thread:

4 computers are connected to the server. The server gives a number to the connected network; this number identified the player. The thread is created for every connected network. This thread waits for information from the port, and sends it to other computers on the network. Computer transmits every player's behaviors to other computers. For example, it gathers the player's domino information (location, number, which the player is playing) and sends it to other players' computers on the network by packaging the game information. Other players' computers receive the package. And then, what the player is playing is now played in these computers and it is displayed on the monitor.

![0_image_0.png](0_image_0.png)

