OnixS C++ CME MDP Conflated TCP Handler 1.3.6
API Documentation
Loading...
Searching...
No Matches
Threading Models

The handler supports the following threading models: OnixS::CME::ConflatedTCP::ThreadingModel::DedicatedThreads and OnixS::CME::ConflatedTCP::ThreadingModel::ThreadPool.

The model is configured via the OnixS::CME::ConflatedTCP::SessionSettings::threadingModel(ThreadingModel::Enum value) method.

DedicatedThreads

In OnixS::CME::ConflatedTCP::ThreadingModel::DedicatedThreads mode the Handler creates a dedicated receiving thread and a dedicated sending thread for each OnixS::CME::ConflatedTCP::Session instance.

The receiving thread receives and processes incoming SBE messages.

The Handler tries to send an outgoing application-level message in the thread that calls the OnixS::CME::ConflatedTCP::Session::send method. If the message cannot be sent immediately, then it is saved to the queue for the subsequent sending by the sending thread. This behavior can be changed using the OnixS::CME::ConflatedTCP::Session::messageGrouping method.

The following table shows which thread could fire a particular callback.

CallbackApplication threadHandler's Sending threadHandler's receiving thread
OnixS::CME::ConflatedTCP::SessionListener::onErrorNoYesYes
OnixS::CME::ConflatedTCP::SessionListener::on*(All incoming strongly typed callbacks)NoNoYes
OnixS::CME::ConflatedTCP::SessionListener::onOutboundApplicationMsgYesYesNo
OnixS::CME::ConflatedTCP::SessionListener::onOutboundSessionMsgYesYesNo
OnixS::CME::ConflatedTCP::SessionListener::onReceivedBytesNoNoYes
OnixS::CME::ConflatedTCP::SessionListener::onMessageSendingYesYesNo
OnixS::CME::ConflatedTCP::SessionListener::onStateChangeYesYesYes
OnixS::CME::ConflatedTCP::SessionListener::onWarningYesYesYes

ThreadPool

In OnixS::CME::ConflatedTCP::ThreadingModel::ThreadPool mode the Handler creates the thread pool and shares it between all sessions.

The maximum number of threads in the pool is configured via the OnixS::CME::ConflatedTCP::SessionSettings::threadPoolSize parameter.

Note
If the OnixS::CME::ConflatedTCP::SessionStorageType::AsyncFileBased value is passed to the OnixS::CME::ConflatedTCP::Session constructor the Handler creates an addition thread for each Session instance. This thread performs session storage operations.