Threads of Diarkis
This document explains the threads used in the Diarkis client.
Last updated
Was this helpful?
This document explains the threads used in the Diarkis client.
Last updated
Was this helpful?
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 instance, if you need to prepare UDP servers for both matching and TURN purposes, you need to have two instances of DiarkisInterfaceBase
for each server. Therefore, four threads will be created in total for the runtime library (two Send Thread
and two Receive Thread
).
In this scenario, only one thread each for the Diarkis Module (Runtime Thread
and Logger Backend
) is created, resulting in a total of 6: 2 for matching, 2 for TURN, and 2 for Diarkis Module. When making a P2P connection, a temporary thread is created for each connection peer.