Home > OS >  Thread A writing, thread B read, can not wait
Thread A writing, thread B read, can not wait

Time:12-30

Thread A to 125 MB of BUF writing data (1 second can fill), another thread B from BUF data rate (A little bit slow), can achieve the thread B take the data, the thread A can continue to BUF populate the data?
Don't know if I have the description is clear, is to improve the efficiency of thread B to send, not in the thread B take the data, the thread A in A wait state, don't want to use the lock,

CodePudding user response:

B read slowly, that you write is sure I have plenty of time to waiting, unless you use two Buf, or three Buf,

CodePudding user response:

Cannot raise rate of B, want to save resources can be considered in the software to simulate the interrupt, the underlying hardware speed matching problem is doing just that,
  • Related