Forums Register Login

Observables

+Pie Number of slices to send: Send
Observables are not threads rite? they get invoked sequentially and there do any further processing also sequentially, not parallely.
Am i right on this?
+Pie Number of slices to send: Send
Correct, Observables are not threads, and they do not create any new threads. When notifyObservers() is called, the Observable calls update() for each Observer in the same thread that was used to call notifyObservers(), sequentially. There may still be other things happening in parallel if your program is already using multiple threads. An Observer can function in a multi-threaded environment, but it does not create any new threads itself.
+Pie Number of slices to send: Send
 

... but it does not create any new threads itself.



Well, it can start a new thread if it wants to. It's not automatic or built in by any means but it is a good thing in some situations to move the reaction to the event to another thread.
Everybody's invited. Even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 717 times.
Similar Threads
Iteration speed of Collections
JBoss performance Tuning in Linux
Flow of Code Control
MVC modify model from outside of the table.
Observable patter in GUI
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:32:19.