eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.68k stars 393 forks source link

Question: Multiple Thread Multiple Publisher #2227

Closed OrenHg closed 7 months ago

OrenHg commented 8 months ago

If i have multiple publisher, each one owns a thread for publish is that thread safe? or i should have a big lock for all publishers: lock the big lock before each publisher try to loan() and publish() ?

elfenpiff commented 8 months ago

@OrenHg if you have a setup with multiple threads, where every thread owns its own publisher so that they are not accessed by any other thread, it is safe to use.

The publisher is not thread-safe, but you can use multiple publishers concurrently from multiple processes or from within the same process with multiple threads.

But you are not allowed to share one publisher with multiple threads and perform concurrent operations on them.

elBoberido commented 7 months ago

Closing the issue since the question was answered