How the producer/consumers are being managed? #89
-
I just tried writing some application with iceoryx2, and I realised that when I quit my previous application with producer/consumer, the iceoryx2 still recognises the previous producer/consumer, and doesn't free up the "slots"; when I rerun my application several times, it says the producer count has exceeded (as the limit configured), despite my application having only 1 producer and 1 consumer. May I know what are the common procedures of using iceoryx2, do I have to explicitly "close" a producer/consumer's connection to the iceoryx2 to free up these "slots"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@kanekoshoyu The problem is that the destructors of all resources must be called, therefore you need to register a ctrl_c handler or something comparable. The simplest thing is that you use the iceoryx2 while let Iox2Event::Tick = Iox2::wait(CYCLE_TIME) {
// your code
} which does it for you. Also, please do not kill the application with We will add this to the FAQ and also move the stale resource cleanup functionality to the top of our priority list. So in the next release, whenever your application detects that resources exist from a previous instance which no longer exists, it will clean them up. |
Beta Was this translation helpful? Give feedback.
@kanekoshoyu The problem is that the destructors of all resources must be called, therefore you need to register a ctrl_c handler or something comparable.
The simplest thing is that you use the iceoryx2
which does it for you. Also, please do not kill the application with
kill -9
so that they loose the ability to clean up their resources.We will add this to the FAQ and also move the stale resource cleanup functionality to the top of our priority list. So in the next release, whenever your application detects that resources exist from a previous instance which no longer exists, it will clean them up.