Skip to content

bind executor to subscribe/publish #2449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
owny990312 opened this issue Apr 7, 2025 · 4 comments
Open

bind executor to subscribe/publish #2449

owny990312 opened this issue Apr 7, 2025 · 4 comments

Comments

@owny990312
Copy link

owny990312 commented Apr 7, 2025

I would like to ask, is there any way to make the subscribe callback run in the specified executor thread API.

In addition, is the listener object multi-threaded when listening to multiple subscribers? Is it possible to configure the number of threads?

@elfenpiff
Copy link
Contributor

@owny990312 I would not recommend to use the Listener at all. If you want to have explicit control over the thread you need to use the WaitSet instead.

Here it is possible to spawn a thread explicitly, maybe from you executor thread API, and handle all events directly.

@owny990312
Copy link
Author

@owny990312 I would not recommend to use the Listener at all. If you want to have explicit control over the thread you need to use the WaitSet instead. 

Here it is possible to spawn a thread explicitly, maybe from you executor thread API, and handle all events directly.

Thank you for your response.
I notice that iceoryx2 seems to only have the waitset mechanism for handling subscription callbacks. During the use of waitset, I see that we need to use: ‘’auto notificationVector = waitset_raw_ptr->wait(); ‘ ’to block and wait for a subscription callback to be notified for execution. I'm wondering if this is thread-safe?

@elfenpiff
Copy link
Contributor

No API of iceoryx is thread-safe if it is not explicitly stated in the documentation. WaitSet::wait() cannot be called from multiple threads.

@owny990312
Copy link
Author

owny990312 commented Apr 16, 2025

No API of iceoryx is thread-safe if it is not explicitly stated in the documentation. WaitSet::wait() cannot be called from multiple threads.iceoryx 的任何 API 如果文档中没有明确说明是线程安全的,则不是线程安全的。 WaitSet::wait() 不能从多个线程中调用。

Thank you for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants