Joe Wilcoxson
unread,Jun 1, 2013, 9:14:56 AM6/1/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to libm...@googlegroups.com
Hello everyone, I'm running in to a little issue. I am using libmodbus in a multithreaded c++ application. The main thread creates the modbus_mapping_t and modbus_new_rtu objects, then two worker threads get created. Thread A is the modbus_receive loop and Thread B writes out certain registers to a text file periodically when a certain modbus bit address is true. The application tends to get hung up in the logging thread, where even if the "start logging" modbus bit is true, it doesnt seem to recognize that until the server thread has been killed. I am relatively new to threading and I think I haven't properly set up the the two threads to share the modbus_mapping_t object. Does anyone have some examples of running libmodbus in a multithreaded application, sharing the modbus_mapping_t object between threads? Using Boost::Threads.