in reply to Re^2: Socket client thread design problem
in thread Socket client thread design problem
I downloaded the C zip you linked only to find it only contains the same trivial, single-threaded examples you already posted (amongst lots of other unrelated examples). But no C code that uses 3 threads and shared sockets and queues and stuff to implement something you claim to be trying to emulate in Perl.
Nothing for me to use as a basis for producing a threaded Perl code to meet the sketchy and confused specs you outline in words.
So, then I start to think about the examples you have posted, and it is my conclusion that you are trying to use threads to mix together two different APIs either of which can serve the purpose on its own.
No need for a callback here. Each client gets the latest value on demand.
And whenever your clients connect, you simply return the current value of that cache variable.
No threads -- unless you choose to use threads for your client connects -- no need or use for queues.
Simplicity personified.
So, unless you can provide a reason for your 3 threads + queues design -- and the C code that implements it -- I can see no reason at all to try and create something that matches your earlier descriptions. Especially from scratch and without reference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Socket client thread design problem
by photron (Novice) on Mar 24, 2014 at 15:09 UTC | |
by BrowserUk (Patriarch) on Mar 24, 2014 at 23:35 UTC |