Hey James! Thanks for the explanation.
Snuck in an extra 0 there. I ment every 50ms, but yeah, I guess it is still doable.
But do I then understand you correctly, that the first listener will create its own two threads to use?
What if I need 2 or even 3 listener, will they create their own as well? Or will they share?
And I guess it's also in order to ask, how many of these threads can you have? Limited by CPU, or a more theoretical Number behind the scenes?
------------------------------
Aleksander Stalsberg
Lillehammer Icehockey Club
------------------------------
Original Message:
Sent: 06-24-2021 09:27
From: James Peltzer
Subject: Multiple listeners - same or different exec? Different from main exec?
Great question, Aleksander.
By default a listener will run 2 threads: 1 to continue to read messages off the wire and another to process any tasks after a message is received. We also have an option to drop this down to a single thread that handles both - this is what the "Stop all receive/task execution on pause" checkbox does. We often use the single thread model when we need to receive/respond/receive/respond or if we need to read additional information directly from the connection's input stream inside of our tasks.
You can certainly use the executors to fire-up additional threads if you need to but 500ms isn't really all that fast for a lot of applications. I suspect you'll be fine as long as you keep your tasks fairly concise.
Cheers
James
------------------------------
James Peltzer
Ross Video
Original Message:
Sent: 06-21-2021 05:49
From: Aleksander Stalsberg
Subject: Multiple listeners - same or different exec? Different from main exec?
Hello there folks!
Question regarding listeners and executors.
Of course you can do the asyncExec in order to run things parallell to the main thread. And you can also create your own execs. Just wondering, listeners, do they create their own execs? Or are the run on the main exec? If we run the listener every 500 ms that's gonna be quite a load on one exec if you have longer/bigger functions included. Of course, I can add my own execs and then run those via that. I'm just wondering how the default setup is for listeners and what they interfere with and not.
Dunno if that made sense to people or not.
------------------------------
Aleksander Stalsberg
Lillehammer Icehockey Club
------------------------------