By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,464 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,464 IT Pros & Developers. It's quick & easy.

Multithread

P: n/a
I'm trying to write a multithread application:

it will get different kind of data from DB, my intention was to create
different thread for each query.
I tryed to use the AsyncHelper.FireAndForget method u can easily find
on this goup but i wasn't lucky: I was able to crate threads but not to
get back results....

Any idea/modification of AsyncHelper.FireAndForget will be gratly
appreciated.

Basicly I need to call a method with parameters (array of parameters)
and get back array of sorted list or similar...

Thanks in advance.

Mar 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Take a look at the backgroundwork class. The runworkercompleted event
has a result property that allows you to return results.

(Note: this is class is new in .Net 2.0)

http://msdn2.microsoft.com/en-US/library/4852et58.aspx

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
Mar 23 '06 #2

P: n/a
..net 2? Try BackgroundWorker.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"amberti" <da*************@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
I'm trying to write a multithread application:

it will get different kind of data from DB, my intention was to create
different thread for each query.
I tryed to use the AsyncHelper.FireAndForget method u can easily find
on this goup but i wasn't lucky: I was able to crate threads but not to
get back results....

Any idea/modification of AsyncHelper.FireAndForget will be gratly
appreciated.

Basicly I need to call a method with parameters (array of parameters)
and get back array of sorted list or similar...

Thanks in advance.

Mar 23 '06 #3

P: n/a
Yes .net 2,
BackgroundWorker seems interesting but what about this:

http://www.yoda.arachsys.com/csharp/...readpool.shtml
and its
http://www.yoda.arachsys.com/csharp/miscutil/
MiscUtil.Threading.CustomThreadPool
? What's best?

Mar 23 '06 #4

P: n/a
I don't find Background worker all that helpful. Here is a simple pattern
you can use for just about any work:
http://channel9.msdn.com/ShowPost.aspx?PostID=171594

--
William Stacey [MVP]

"amberti" <da*************@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
| I'm trying to write a multithread application:
|
| it will get different kind of data from DB, my intention was to create
| different thread for each query.
| I tryed to use the AsyncHelper.FireAndForget method u can easily find
| on this goup but i wasn't lucky: I was able to crate threads but not to
| get back results....
|
| Any idea/modification of AsyncHelper.FireAndForget will be gratly
| appreciated.
|
| Basicly I need to call a method with parameters (array of parameters)
| and get back array of sorted list or similar...
|
| Thanks in advance.
|
Apr 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.