Multi-thread use in photon
Options
Comments
-
there are aspects in its related deeper handling thats parallel yes and thats safe, it uses the fibers0
-
The peer OnOperationRequest is thread-safe per peer but to make it perform better, multiple peers are run parallel!
So access from one peer to another should be done via messages/fibers as well.
If you need a number of clients to modify the same object you can possibly do this by using rooms. In the Lite application, peers will forward some Operations to their room via another message. The room itself is handling these messages sequenced and in a thread safe manner. Operations in a room might change objects which several peers need access to.
Rooms in turn have to avoid modifying other rooms directly.0 -
How do you decide if OnOperationRequest is multithreaded ? Is it automatic or do you have to set the number of thread you wish somewhere ?0
-
Its automatic, the total number of threads used on a photon application is configured in the config file within the instance configurations
best read the documentation on how to configure photon to learn more about it0 -
Thank you dreamora !0