This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Thread groups
Guerro323 edited this page Dec 27, 2017
·
2 revisions
You have the possibility to use thread groups to manage the multithreading of a worker. You can also create your own thread group or even use the Unity thread group (if you don't want to use multi-threading possibilities).
Normal thread group creation from a worker:
EudiSynchronizationType synchronizationType = EudiSynchronizationType.TrueMultiThreading;
int workId = 0;
// Create the thread group...
var myThreadGroup = EudiThreading.GetThreadGroup<MyWorker>();
SetThreadShareParam(workId, myThreadGroup, synchronizationType);
Unity worker group creation from a worker:
UnityUpdateType updateType = UnityUpdateType.Update; //< Also available: FixedUpdate, LateUpdate
int groupId = 0;
int workId = 0;
// Create the unity worker group...
UnityThreadGroup myUnityGroup = new UnityThreadGroup(updateType, typeof(MyWorker), groupId);
// Create the legacy thread group...
var myThreadGroup = EudiThreading.GetThreadGroup<MyWorker>(existingGroup: myUnityGroup);
SetThreadShareParam(workId, myThreadGroup);
A unity worker group should always have his groupId
and workId
set to 0.