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

From what I understand of your problem, using Coro should work. Basically, your program should be something like your threads example, except that you use Coro::LWP and you use Coro instead of OS threads.

What have you tried so far that gives you problems?

Maybe you want to start with a small example program that does not talk to your vendor but tries to make several parallel requests to Google?

  • Comment on Re^3: Do I need to use Coro instead of threads/forks

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:14 UTC

    I have created a test where i removed vendors and put in Coros instead of threads both in main and worker threads.
    The script works fine even on actual data (tried with only two vendors i.e. 2 main threads and thread 1 opening 2 more inside it).
    I am observing time taken to complete output and have not seen any improvement so far.
    Further testing needs to be done to see if it is fetching data in parallel.
    In 3 iterations it took 12 to 17 sec to finish.
    With OS threads it should be around 10 to 12 sec. (need to confirm)

      Note that you cannot present all data until the last vendor has replied.

      If you want to present information as it becomes available, you will need to add Javascript code on the browser side to read the information as it becomes available and progressively display the information to the user.