in reply to Re^2: Do I need to use Coro instead of threads/forks
in thread Do I need to use Coro instead of threads/forks
Biggest problem is main threads must wait till all threads return data,
Why is that a problem?
As I understand it, you have a cgi that accepts some user search terms. Once those search terms are returned to you, you then want to forward those terms to several vendor sites, aggregate the information they return to you, and then present the aggregation back to the user. (Is that correct? )
You cannot present the aggregation until you have all the data; so why is it a problem to wait for the threads to complete?
Unless you are hoping to present the data back to the user piecemeal, as you receive it?
In which case: set up a queue; detach the threads and have them post the data they receive to that queue. Then you main thread does not have to wait for all the threads to complete; it simply monitors the queue and deals with the data as it arrives.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Do I need to use Coro instead of threads/forks
by mohan2monks (Beadle) on Sep 29, 2014 at 13:27 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2014 at 13:41 UTC | |
by mohan2monks (Beadle) on Sep 30, 2014 at 11:42 UTC | |
by BrowserUk (Patriarch) on Sep 30, 2014 at 13:13 UTC | |
by mohan2monks (Beadle) on Sep 30, 2014 at 14:08 UTC | |
|