Answer the question
In order to leave comments, you need to log in
Is it worth using Mutex in a project (ModBus) with a huge number of threads?
It so happened that the last module in the project was written by a student who was going to leave soon and did a bunch of bad things. We'll have to rewrite soon, tk. there are even bugs in the likeness that 1 thread will spawn exponentially new threads after reconnects, etc.
And yet, for greater security, I'm thinking of doing it on the basis of mutexes. The only problem is that this mechanism requires (in my memory) decently so many resources.
If there are more than 3000 subscriptions in the modbus, is it worth resorting to normal practice? Or get confused with complex logic, but more productive?
ps with resources it seems to be a problem, the servers at the university are the same and they have everything there through one place :)
Answer the question
In order to leave comments, you need to log in
I personally see the need for a single mutex to write to the port in turn. The protocol is half-duplex, more than one mutex, where is it?
A lot of nuances. The number of worker threads depends on the hardware and is limited by its performance. If you need high performance, then you should think about leaving modbus, it is not a very productive protocol.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question