in reply to Re^3: Forking Clients
in thread Forking Clients
This is a rather simple proof of concept, the final implementation would involve the rpc function being called from multiple different places, possibly simultaneously, in this case I want the caller to wait until its response is ready, when it is it should grab it and go on, while the other callers continue to wait.
In Pseudo code it would be some thing like this:
function rpc do thread and queueing stuff in here end rpc function blah rpc(IP, port2, command) look at queue see if your result is there if it is not wait else do other stuff with the info end blah function blee rpc(IP, port1, command) look at queue see if your result is there if it is not wait else do other stuff with the info end blah
These function may very well call rpc at the same time, they will always use different port numbers. How would I go about using the queue to determine if my information is back, since in each instance of the call I won't know how many ports I have open, it only knows about the port it was told to use. Should I dequeue check the port/result and if it doesn't match enqueue it again?
I really appreciate all your help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Forking Clients
by BrowserUk (Patriarch) on Oct 15, 2008 at 18:31 UTC | |
by gepapa (Acolyte) on Oct 15, 2008 at 19:05 UTC | |
by BrowserUk (Patriarch) on Oct 15, 2008 at 23:04 UTC | |
by gepapa (Acolyte) on Oct 16, 2008 at 13:11 UTC | |
by BrowserUk (Patriarch) on Oct 16, 2008 at 13:59 UTC | |
| |
by mr_mischief (Monsignor) on Oct 15, 2008 at 21:05 UTC | |
by gepapa (Acolyte) on Oct 16, 2008 at 12:31 UTC | |
by mr_mischief (Monsignor) on Oct 16, 2008 at 19:30 UTC |