Confusion regarding waitone

A

archana

Hi all,

I am not clear regarding waitone of manualresetevent.

I am invoking webrequest asynchronously with say 5 requests at a time.

What i am doing is after invoking request i am calling waitone and
allowing to wait for 2 mins.

And then doing some processing.

What i want to know is after calling waitone on thread if i havent'
reset my event, will it cause any problem.

Means here i am calling waitone with 2 mins to allow asychrnous web
request to complete.

But i can't wait indefinitely so i am calling waitone with 2 mins.

Is there anything wrong in this logic.

Please correct me if i am wrong.

Thanks in advance.
 
J

Jianwei Sun

archana said:
Hi all,

I am not clear regarding waitone of manualresetevent.

I am invoking webrequest asynchronously with say 5 requests at a time.

What i am doing is after invoking request i am calling waitone and
allowing to wait for 2 mins.

And then doing some processing.

What i want to know is after calling waitone on thread if i havent'
reset my event, will it cause any problem.
[Based on the boolean value returned from the waitone, you should be
able to know whether it's returned because the signal of the other
thread, or the time out.

1> If it's signaled by the other thread, then the work is done, you are
good to go.
2> If it's time out, then you have to decide what you do here, send
another request, and wait on the handle again, or just issue some error
/warning message.
]
 
G

Guest

Archana,
Provided you are using the overload with a timeout, there should be no
problem.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top