Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help with an regular expression Pin
Paw Jershauge28-Jun-08 3:22
Paw Jershauge28-Jun-08 3:22 
GeneralRe: Need help with an regular expression Pin
User 665828-Jun-08 3:31
User 665828-Jun-08 3:31 
GeneralRe: Need help with an regular expression Pin
Paw Jershauge30-Jun-08 8:47
Paw Jershauge30-Jun-08 8:47 
Questionarray string using dynamically Pin
maruthi26-Jun-08 23:24
maruthi26-Jun-08 23:24 
AnswerRe: array string using dynamically Pin
Guffa26-Jun-08 23:36
Guffa26-Jun-08 23:36 
GeneralRe: array string using dynamically Pin
maruthi26-Jun-08 23:56
maruthi26-Jun-08 23:56 
AnswerRe: array string using dynamically Pin
dan!sh 26-Jun-08 23:38
professional dan!sh 26-Jun-08 23:38 
QuestionAsynchronous processing - More number of processes are not running parallel Pin
N a v a n e e t h26-Jun-08 23:23
N a v a n e e t h26-Jun-08 23:23 
I am on a multi threaded application which is a file downloader from FTP server. I have created a producer/consumer style custom class which manages a download queue and processes the items one by one in the queue. I am adding delegate instances to the queue and when one thread picks the item, it invokes the delegate instance to start the work.

For downloading files from FTP, I used WebClient classes DownloadFileAsync. My custom class wraps webclient and it's events. I have noticed this is downloading only 2 files at a time. All the other requests are queued and will be executed one by one.

My "DownloadQueue" class is working well. It creates the specified number of threads and dequeues each item when threads become free. I found problem is in DownloadFileAsync method of WebClient. It uses asynchronous fashion and obviously using a thread pool thread to download the file. I learned that, thread pool creates only 2 threads by default and all the other requests will be queued until threads become free. I tried increasing the thread count by ThreadPool.SetMinThread(), but it didn't worked. Still it's downloading only two files at a time.

I am sure I have called DownloadFileAsync 5 times from 5 threads. 2 of them started immediately and remaining 3 gets queued. Any idea to solve this issue ?

All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

How to use google | Ask smart questions

AnswerRe: Asynchronous processing - More number of processes are not running parallel Pin
leppie27-Jun-08 3:43
leppie27-Jun-08 3:43 
GeneralRe: Asynchronous processing - More number of processes are not running parallel Pin
N a v a n e e t h27-Jun-08 20:38
N a v a n e e t h27-Jun-08 20:38 
GeneralRe: Asynchronous processing - More number of processes are not running parallel Pin
leppie27-Jun-08 23:56
leppie27-Jun-08 23:56 
GeneralRe: Asynchronous processing - More number of processes are not running parallel Pin
N a v a n e e t h28-Jun-08 5:02
N a v a n e e t h28-Jun-08 5:02 
AnswerRe: Asynchronous processing - More number of processes are not running parallel Pin
S. Senthil Kumar27-Jun-08 4:17
S. Senthil Kumar27-Jun-08 4:17 
GeneralRe: Asynchronous processing - More number of processes are not running parallel Pin
N a v a n e e t h27-Jun-08 20:34
N a v a n e e t h27-Jun-08 20:34 
QuestionAccessing data in Excel 4.0 Pin
kbalias26-Jun-08 22:49
kbalias26-Jun-08 22:49 
AnswerRe: Accessing data in Excel 4.0 Pin
Jimmanuel27-Jun-08 3:03
Jimmanuel27-Jun-08 3:03 
Questionjavascript in c#.net [modified] Pin
swetham26-Jun-08 21:36
swetham26-Jun-08 21:36 
AnswerRe: javascript in c#.net Pin
Simon P Stevens26-Jun-08 22:19
Simon P Stevens26-Jun-08 22:19 
GeneralRe: javascript in c#.net Pin
Pete O'Hanlon26-Jun-08 23:16
mvePete O'Hanlon26-Jun-08 23:16 
GeneralRe: javascript in c#.net Pin
Simon P Stevens26-Jun-08 23:30
Simon P Stevens26-Jun-08 23:30 
GeneralRe: javascript in c#.net Pin
Pete O'Hanlon27-Jun-08 0:22
mvePete O'Hanlon27-Jun-08 0:22 
Questioncreate patch Pin
Maddie from Dartford26-Jun-08 21:35
Maddie from Dartford26-Jun-08 21:35 
AnswerRe: create patch Pin
Giorgi Dalakishvili26-Jun-08 21:51
mentorGiorgi Dalakishvili26-Jun-08 21:51 
GeneralRe: create patch Pin
leppie26-Jun-08 23:25
leppie26-Jun-08 23:25 
GeneralRe: create patch [modified] Pin
Giorgi Dalakishvili27-Jun-08 4:03
mentorGiorgi Dalakishvili27-Jun-08 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.