You're still demonstrating something that shows no advantage to using threads.
If the users callback is simply going to push inbound messages from a single source onto an array. And the main thread is just going to access them. What is having the point/advantage of using a thread in the first place?
To be more explicit. What information needs to be shared between which threads? And why?
In reply to Re^7: Thread-safe modules and callbacks
by BrowserUk
in thread Thread-safe modules and callbacks
by Saladino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |