Threads in Diarkis
This document explains the threads used in the Diarkis client.
Last updated
This document explains the threads used in the Diarkis client.
Last updated
This page explains the threads used in Diarkis. The threads within the Diarkis Module are created during the initialization of DiarkisInterfaceBase::DiarkisInit()
. When IDiarkisTransport::Connect()
is called, threads for UDP/TCP/P2P are created. The number of runtime library threads will increase according to the Diarkis server you connect to.
Runtime Library
When connecting to a UDP server, the following two are created:
Send Thread: A thread for sending packets accumulated in the Send Pedding Buffer.
Receive Thread: A thread to push events to the Event Scheduler from the packets received by the socket.
When connecting to a TCP server, the following one is created:
Network Thread: A thread for sending and receiving packets.
For P2P connections, the following is created for each connection partner:
Holepunch Thread: A temporarily created thread used during hole punching.
Diarkis Module
Runtime Thread: A thread for invoking response/notification events from the Diarkis server.
Logger Backend Thread: A thread for buffering and processing logs in Diarkis.
For example, if you prepare UDP
servers for both matching and TURN, you need separate instances of DiarkisInterfaceBase
for each server, resulting in 4 threads (2 Send Threads
and 2 Receive Threads
). In this case, the Diarkis Module threads (Runtime Thread
and Logger Backend
) are created just once each, totaling 6 threads for Matching x2, TURN x2, and Diarkis Module x2. Temporary threads are also created per connection when establishing P2P connections.