Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 7:13
sitebuilderLuc Pattyn21-Jul-07 7:13 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 7:28
sitebuilderLuc Pattyn21-Jul-07 7:28 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 7:49
Johan Martensson21-Jul-07 7:49 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 8:18
sitebuilderLuc Pattyn21-Jul-07 8:18 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 9:18
Johan Martensson21-Jul-07 9:18 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 9:54
sitebuilderLuc Pattyn21-Jul-07 9:54 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 10:39
Johan Martensson21-Jul-07 10:39 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 11:03
sitebuilderLuc Pattyn21-Jul-07 11:03 
Hi,

OK, lets not dive into CalculateDownloadingInfo() for the moment (it calls an event now,
for which I dont have the code...);

this is what I suggest:

- remove CalculateDownloadingInfo from the while loop (i.e. turn it onto a comment for now).
- remove the line if(thrDownload != null) thrDownload.Abort(); it seems to still be present.
- add say 5 more log statements inside StartDownload; say before and after webRequest=...;
before and after the while loop that copies the data; and at the end of finally.
- now run again, make sure it still works and still is slow, then study the log timestamps.
if everything is as you expect, the four threads should begin their job at about the same
time, and, if it still acts rather sequentially soon 3 of them come to a stand still.
The times will tell you exactly where that happens, and then you will have a good
opportunity to figure out why that happens.
- if you decide to post the log again, please also repost the code for StartDownload()

I would not be surprised it is the progress event that is taking too much time, and for
some reason causing things to run sequentially (hence things running better as long as
you keep it out).

Come to think of it, updating after every 2KB is way too often (if you
hope to transfer 1 MB/s that would result in an update every 2 msec !)

But even if that's true I cant yet explain the sequential behavior; so if removing the
update helps, I would like to see the code actually executed in updating the GUI...

Smile | :)


GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 11:32
Johan Martensson21-Jul-07 11:32 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 11:51
sitebuilderLuc Pattyn21-Jul-07 11:51 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn21-Jul-07 13:08
sitebuilderLuc Pattyn21-Jul-07 13:08 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson21-Jul-07 22:14
Johan Martensson21-Jul-07 22:14 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn22-Jul-07 0:34
sitebuilderLuc Pattyn22-Jul-07 0:34 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson24-Jul-07 0:15
Johan Martensson24-Jul-07 0:15 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn24-Jul-07 1:01
sitebuilderLuc Pattyn24-Jul-07 1:01 
GeneralRe: Thread, WaitSleepJoin Pin
Johan Martensson24-Jul-07 8:21
Johan Martensson24-Jul-07 8:21 
GeneralRe: Thread, WaitSleepJoin Pin
Luc Pattyn24-Jul-07 11:54
sitebuilderLuc Pattyn24-Jul-07 11:54 
QuestionDataSource binding problem Pin
~~~Johnny~~~21-Jul-07 3:27
~~~Johnny~~~21-Jul-07 3:27 
AnswerRe: DataSource binding problem Pin
~~~Johnny~~~21-Jul-07 5:01
~~~Johnny~~~21-Jul-07 5:01 
GeneralRe: DataSource binding problem Pin
Urs Enzler22-Jul-07 6:24
Urs Enzler22-Jul-07 6:24 
GeneralRe: DataSource binding problem Pin
~~~Johnny~~~23-Jul-07 6:03
~~~Johnny~~~23-Jul-07 6:03 
GeneralRe: DataSource binding problem Pin
Urs Enzler29-Jul-07 21:40
Urs Enzler29-Jul-07 21:40 
Questionadd header and footer to a dynamically generated word Pin
Nitin Varambally21-Jul-07 3:23
Nitin Varambally21-Jul-07 3:23 
QuestionConverting a Form to a Windows Service Pin
Ben297521-Jul-07 2:35
Ben297521-Jul-07 2:35 
AnswerRe: Converting a Form to a Windows Service Pin
Luc Pattyn21-Jul-07 3:09
sitebuilderLuc Pattyn21-Jul-07 3:09 

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.