Skip to content
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

Thread concurrence for 1 external broker producer/consumer #2170

Closed
nachopol opened this issue Dec 29, 2018 · 3 comments
Closed

Thread concurrence for 1 external broker producer/consumer #2170

nachopol opened this issue Dec 29, 2018 · 3 comments

Comments

@nachopol
Copy link

Hi @edenhill. I'm trying to port librdkafka to OpenVOS (I read other threads and I know this OS is not supported). Anyway, I could compile it and successfully test two instances of the example rdkafka_example program as a producer and a consumer respectively using an external broker in a win Kafka installation.

According what I've understood in the FAQs, having in mind the following architecture each instance should have 2 threads (the main and the per-broker ones):

  • Kafka broker in an external server
  • Producer or Consumer separate instances conected to one sole broker

In this architecture, will it work a #define RD_TLS #2014 (comment)
or is it going to break at any point?

Thanks in advance

@nachopol nachopol changed the title Single thread producer/consumer Thread concurrence for 1 external broker producer/consumer Dec 29, 2018
@write2jaydeep
Copy link

Hey @nachopol
it works perfectly fine. if you know that openVOS has separate scope per threads for static variables. This directive works well for me.

Thanks
JD

@nachopol
Copy link
Author

nachopol commented Jan 5, 2019

Hi @write2jaydeep, thanks for answering.
I haven't found anything about the scope behaviour you talk about in stratadoc website (do you have the exact reference?).
Anyway, as far as I understand, there are still two non-static RD_TLS variable declaration:
rd_kafka_resp_err_t RD_TLS rd_kafka_last_error_code; in rdkafka.c
int RD_TLS rd_kafka_yield_thread = 0; in rdkafka_queue.c

@edenhill
Copy link
Contributor

edenhill commented Jan 7, 2019

@nachopol Defining RD_TLS to nothing will not work, any code that is marked with RD_TLS needs its thread-local-storage, or must be rewritten in a way that does not use TLS (which most likely involves changes to the internal or public API).

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

3 participants