473,499 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GC effect on runtime

Hi All,
I posted this request on ...dotnet.framework.interop newsgroup, but I
thought to try also here, and ask to get your inputs for the following
issue:
I have an application written in C++, and now I'm going to add another
module to it, which I'm going to write in C#, and wrap it as a COM.
The new module is going to interact with the existing application during
runtime (call the application's methods and run some BL according to the
return values). My concern is regarding the GC mechanism of the .NET
environment - I know that there is an effect on the runtime, because of
delay that occurred while the environment calls the GC, but my question is -
can it be that during this "pause", the C++ application, which executes some
other COM's, will miss their return values because the GC was called? or
that while calling the GC, ALL the events/calls are being "paused" and "wake
up" after the delay?

TIA,
Tal.
Nov 17 '05 #1
3 1406
> I have an application written in C++, and now I'm going to add another
module to it, which I'm going to write in C#, and wrap it as a COM.
The new module is going to interact with the existing application during
runtime (call the application's methods and run some BL according to the
return values). My concern is regarding the GC mechanism of the .NET
environment - I know that there is an effect on the runtime, because of
delay that occurred while the environment calls the GC, but my question is - can it be that during this "pause", the C++ application, which executes some other COM's, will miss their return values because the GC was called? or
that while calling the GC, ALL the events/calls are being "paused" and "wake up" after the delay?

The effect is very small so I doubt that you will even notice it.
In games you might see this effect that your frame rate drops for a few
heartbeats which could be a small problem.
The biggest slowdown might occur is you call a .NET function that was not
used yet and use other dll's and thus must be compiled by the CLR.

..NET functions work exactly the same way as normal DLL functions, it is very
unlikely that a return value gets missed, unless you do something very funny
in your code in combination with multi-threading.

One important thing to know about the GC is that it only disposes memory
that it discovers that it has no pointer assigned to it. It does this by
analyzing your memory, And it never gave any problems in my code in the last
few years I have been using it. There is no hidden generated code in your
application of you disassemble it, that calls a destructor or anything else
that you would find in C++ code. So this actually speeds up you code,
because it only disposes it when it runs out of memory.

Care must be taken about limited resources, like file handles, and paint
brushes and others... These are the only things that you must actually
dispose yourself, but don't do it in the destructor since that is called
when you run out of memory, which is anoying if a file does not gets closed
for seconds because the GC has not started up to call de destructor.
Nov 17 '05 #2
In my opinion Microsoft should never have talked about the GC because many
discussions are emotional based, and if people did not now about the GC then
they would probably had never had problems with it. ;-) But for old-style
programmers it is very hard not thrust the language that all memmory will be
released without having control over it. ;-) It is a leap of faith. ;-)
Nov 17 '05 #3
The short answer is: - Yes it will block. No worries.

But a gen0 collect is hardly noticable, while a gen2 collect can hurt and
actually stall an application.

Happy Garbage Collection
- Michael S
"Tal Shachar" <ts************@bezeqint.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All,
I posted this request on ...dotnet.framework.interop newsgroup, but I
thought to try also here, and ask to get your inputs for the following
issue:
I have an application written in C++, and now I'm going to add another
module to it, which I'm going to write in C#, and wrap it as a COM.
The new module is going to interact with the existing application during
runtime (call the application's methods and run some BL according to the
return values). My concern is regarding the GC mechanism of the .NET
environment - I know that there is an effect on the runtime, because of
delay that occurred while the environment calls the GC, but my question
is -
can it be that during this "pause", the C++ application, which executes
some
other COM's, will miss their return values because the GC was called? or
that while calling the GC, ALL the events/calls are being "paused" and
"wake
up" after the delay?

TIA,
Tal.

Nov 17 '05 #4

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

Similar topics

13
11044
by: Don | last post by:
I just put up php.ini-recommended as php.ini in the server-side working directory where my php scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php...
16
3392
by: Maciej Kalisiak | last post by:
I use this simple test in Python: def foo(i): print i foo(i+1) import sys sys.setrecursionlimit(1000000) foo(0) Now, my understanding is that I get the segfault when Python overruns the C
2
3980
by: Susanna | last post by:
Hi all, I'm using the following slideshow script that I found on the web to display changing images with a crossfade effect. Eventually I will be adding many more images to the slideshow. The...
7
1140
by: wij | last post by:
Hi: I encountered an expression B b(A()) which seemd to have no runtime code compiled (as in the following example). Can anybody explain this to me? Thank you. // Build: g++ t.cpp (GCC...
6
2879
by: pradeep_TP | last post by:
Hi all, I am using IIS 5.0 and this question is regarding working of ASP.net worker process. I have only one web application right now on my web server. This means that only one AppDomain will...
3
1858
by: jack | last post by:
Hi im making a scheduler, in house project in which im using a calender control. in this is possible to ger an hover effect (or a color change ) of a cell which i do mouse over on this control . ...
3
5233
by: Beamer | last post by:
Hi I am trying to build a roating slide effect in javascript. Basically, I have a list like below <ul id="slideShowCnt"> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li...
6
4211
by: SMcK | last post by:
I have a PDA-based (Syware Visual CE) database which I need to sync to an Access database. The Access database contains three tables: 1 is the data itself, 2 is a linked table that prefills...
7
2841
by: nolo contendere | last post by:
the alert message appears before the Effect.SlideUp even begins. How can I ensure that the SlideUp completes before executing the next statement? I've tried setTimeout, and I can kind of get it to...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.