473,320 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

first exception pause

What can I do in order to avoid first exception pause?
I am sure everyone already experienced this behavior and there must be a
solution.

regards
Nov 16 '05 #1
11 1685
What exactly did you mean by "first exception pause"?

"Marek" wrote:
What can I do in order to avoid first exception pause?
I am sure everyone already experienced this behavior and there must be a
solution.

regards

Nov 16 '05 #2
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?

reagrds

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
What exactly did you mean by "first exception pause"?

"Marek" wrote:
What can I do in order to avoid first exception pause?
I am sure everyone already experienced this behavior and there must be a
solution.

regards

Nov 16 '05 #3
This is weird...i haven't experienced this issue before. Could you post the
code as well?

"Marek" wrote:
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?

reagrds

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
What exactly did you mean by "first exception pause"?

"Marek" wrote:
What can I do in order to avoid first exception pause?
I am sure everyone already experienced this behavior and there must be a
solution.

regards


Nov 16 '05 #4
I think I got your point. I experienced this kind of scenario before
however, it was in a particular method call. If I can remember it
correctly, I have this method that always take some time the first time it
executes. The next time it execute again, I can observe the increase in
performance (speed wise). My hunch before is that the .NET framework
behaves just like the stored procs of SQL that it somewhat uses caching, JIT
just reuses the same method the second time it encounters the method. It
only had the slower speed performance on the first call where JIT tries to
compile it for the first time.

I don't really know, anyone who has a better insight?

"Marek" <ma**************@sbcglobal.net> wrote in message
news:dR*****************@newssvr31.news.prodigy.co m...
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?

reagrds

"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
What exactly did you mean by "first exception pause"?

"Marek" wrote:
What can I do in order to avoid first exception pause?
I am sure everyone already experienced this behavior and there must be a solution.

regards


Nov 16 '05 #5
Marek <ma**************@sbcglobal.net> wrote:
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?


It's interesting - I was commenting on this just the other day.

I had a test program which *used* to pause for a second, but doesn't
seem to any more. It's possible that the upgrade to .NET 1.1 SP1 has
improved things.

I don't know the exact cause, but one thing you could consider is
queuing a ThreadPool work item which just throws (and catches) an
exception at startup. That way you shouldn't have any problems later
on.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6
Thank you, Jon.
Nice idea.

reagrds
Marek

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Marek <ma**************@sbcglobal.net> wrote:
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?


It's interesting - I was commenting on this just the other day.

I had a test program which *used* to pause for a second, but doesn't
seem to any more. It's possible that the upgrade to .NET 1.1 SP1 has
improved things.

I don't know the exact cause, but one thing you could consider is
queuing a ThreadPool work item which just throws (and catches) an
exception at startup. That way you shouldn't have any problems later
on.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #7
I've seen similar behaviour when program was running in debug configuration
under VS.NET sometimes.
However the pause wasn't present in release config without vs.net.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Marek <ma**************@sbcglobal.net> wrote:
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?


It's interesting - I was commenting on this just the other day.

I had a test program which *used* to pause for a second, but doesn't
seem to any more. It's possible that the upgrade to .NET 1.1 SP1 has
improved things.

I don't know the exact cause, but one thing you could consider is
queuing a ThreadPool work item which just throws (and catches) an
exception at startup. That way you shouldn't have any problems later
on.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #8
I've seen the same problem and had "fixed" it the same way as you
suggested - throw and swallow an exception in a background thread. One
possible reason why some products exhibit this while others don't is that
there may be exceptions thrown during startup by portions of the BCL that it
swallows, so the delay is build right into the app startup time.

I believe one of the causes of the delay is that the runtime has to
interpret the contents of the stack to build the stack trace, and this
requires loading additional assemblies and code, parsing the stack, etc.
Another is that the code path an exception takes involves trips through the
kernel, notifications sent to the debugger port via the Win32 subsystem,
etc., such that lots of DLLs need to get loaded that are not normally
loaded.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Marek <ma**************@sbcglobal.net> wrote:
Well, I thought it was a well known issue.

Anyway, the problem is that when an exception occurs for the first time,
application is "freezed" for a couple of seconds.
When further exceptions occur, there is no problem, they are raised
immediately without blocking the application.
The problem seems to be only with the first one.

Has anybody experienced such situation? Are there any solutions?


It's interesting - I was commenting on this just the other day.

I had a test program which *used* to pause for a second, but doesn't
seem to any more. It's possible that the upgrade to .NET 1.1 SP1 has
improved things.

I don't know the exact cause, but one thing you could consider is
queuing a ThreadPool work item which just throws (and catches) an
exception at startup. That way you shouldn't have any problems later
on.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #9
David Levine <no****************@wi.rr.com> wrote:
I've seen the same problem and had "fixed" it the same way as you
suggested - throw and swallow an exception in a background thread. One
possible reason why some products exhibit this while others don't is that
there may be exceptions thrown during startup by portions of the BCL that it
swallows, so the delay is build right into the app startup time.

I believe one of the causes of the delay is that the runtime has to
interpret the contents of the stack to build the stack trace, and this
requires loading additional assemblies and code, parsing the stack, etc.
Another is that the code path an exception takes involves trips through the
kernel, notifications sent to the debugger port via the Win32 subsystem,
etc., such that lots of DLLs need to get loaded that are not normally
loaded.


Yes, that was my thought too. What's interesting though is that on my
laptop, where IO is much slower than the CPU, when I was able to
reproduce this, the CPU was 100% busy while the exception was being
thrown. That suggests it's more than just loading stuff. Definitely
odd.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #10
>
Yes, that was my thought too. What's interesting though is that on my
laptop, where IO is much slower than the CPU, when I was able to
reproduce this, the CPU was 100% busy while the exception was being
thrown. That suggests it's more than just loading stuff. Definitely
odd.

--

Hmmm, yes; it's hard to tell what that really means. It suggests it is
performing some sort of internal calculation, but it could be operating
system related as opposed to a runtime issue.

Ah well, I suppose what this *really* means is that we will be buying
new/faster/better hardware and help keep Dell/Gateway et al in business.
Perhaps 64 bit computers will be the magic bullet that makes all performance
related issues disappear :-)

Nov 16 '05 #11
David Levine <no****************@wi.rr.com> wrote:
Yes, that was my thought too. What's interesting though is that on my
laptop, where IO is much slower than the CPU, when I was able to
reproduce this, the CPU was 100% busy while the exception was being
thrown. That suggests it's more than just loading stuff. Definitely
odd.
Hmmm, yes; it's hard to tell what that really means. It suggests it is
performing some sort of internal calculation, but it could be operating
system related as opposed to a runtime issue.

Ah well, I suppose what this *really* means is that we will be buying
new/faster/better hardware and help keep Dell/Gateway et al in business.
Perhaps 64 bit computers will be the magic bullet that makes all performance
related issues disappear :-)


It looks like it only happens in debug, actually, so we shouldn't
really worry about performance for releasing our products in these
terms.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
7
by: arajunk | last post by:
I was looking around for some code for a special purpose and found this. Seems it should print "here we go" , pause 5 seconds, print "now we are back". Instead, it pauses 5 seconds before...
5
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas...
3
by: jdph40 | last post by:
In Access 2002, I designed a simple database for our Safety department to enter results of a survey. There are 41 true/false statements. I have a main form called frmSurvey with a subform called...
11
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
3
by: Andreas | last post by:
Hi NG, i encountered a problem during developing some activex control with c#. I read an article that it is possible to expose windows forms as activex controls. So I tried it and it worked...
38
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
2
by: shumaker | last post by:
We are new to using the Tests in VS 2005, and they are really great, but we are having a problem with them in regards to exceptions. Any many cases when we are debugging code we would like...
6
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.