B
Boki
Multi-thread read/write to a single file.
I have two processing threads, thread A and thread B; and I called my
queue as Q.
Thread A will feed data into Q by user input, the timing is random.
Thread B will read data from Q to process; this processing will
communicate with a website.
I think the best Q architecture is ring buffer as large as possible.
However, my idea is to create a textbox.
The problem is the two threads might read/write to Q at the same time.
So, what I need to do is to suspend thread whenever user is submitting
data to Q?
How about when thread B is deleting data (because the data was
processed), I might need to suspend thread A, but thread A is user
interface, there should never a latency.
So, my idea is, UI should separate from processing thread.
Please give me any of your ideas.
Thanks!
Best regards,
Boki.
I have two processing threads, thread A and thread B; and I called my
queue as Q.
Thread A will feed data into Q by user input, the timing is random.
Thread B will read data from Q to process; this processing will
communicate with a website.
I think the best Q architecture is ring buffer as large as possible.
However, my idea is to create a textbox.
The problem is the two threads might read/write to Q at the same time.
So, what I need to do is to suspend thread whenever user is submitting
data to Q?
How about when thread B is deleting data (because the data was
processed), I might need to suspend thread A, but thread A is user
interface, there should never a latency.
So, my idea is, UI should separate from processing thread.
Please give me any of your ideas.
Thanks!
Best regards,
Boki.