Is the Reactor object threadsafe?

470 Views Asked by At

Is the Reactor Event threadsafe? What I mean is: Can I access it from any thread for example to do a mass-notify operation or to register some event handlers? Or do I have to lock it somehow?

1

There are 1 best solutions below

0
On BEST ANSWER

Reaching into a thread at random and tinkering with its data is generally not a good idea. You'd want to write your reactor in such a way that it's listening for external messages. Depending on your performance needs, this could be as simple as external pause/resume messages where the reactor stops processing other inputs when it receives the pause message.