ThreadPool or BeginInvoke()?

  • Thread starter Thread starter fred
  • Start date Start date
F

fred

I'm writing an application invoking asynchon methods.

I envision using the .NET thread pool since it matches
well my needs.

There is (at least) 2 methods to do that:
using ThreadPool class directely or using the BeginInvoke
() of a delegate.

Does anybody knows any advantages from one method to
another?

thank you
 
fred said:
I'm writing an application invoking asynchon methods.

I envision using the .NET thread pool since it matches
well my needs.

There is (at least) 2 methods to do that:
using ThreadPool class directely or using the BeginInvoke
() of a delegate.

Does anybody knows any advantages from one method to
another?

See http://www.pobox.com/~skeet/csharp/threads/threadpool.shtml for
detailed comments, but:

o QueueUserWorkItem only allows a single parameter, of type object
o QueueUserWorkItem doesn't allow you to specify a callback
o QueueUserWorkItem doesn't require EndInvoke or anything similar

(The reverse is true for BeginInvoke in each case.)
 

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

Back
Top