473,395 Members | 1,915 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,395 software developers and data experts.

CLR behavior about accessing data during garbage collection working

I got a curiosity while using CLR.
How can it be done that accessing object data by CLR application is safe
even while garbage collector is working? Is the GC thread running in
realtime priority for this for example?
Please reply. Thanks in advance.

Hyun-jik Bae

Nov 10 '06 #1
5 1454
The CLR pauses all threads while garbage collecting. Thats why it is a
performance hit to call it yourself and to keep invoking it with short term
memory allocations.

Ciaran O'Donnell

"Hyun-jik Bae" wrote:
I got a curiosity while using CLR.
How can it be done that accessing object data by CLR application is safe
even while garbage collector is working? Is the GC thread running in
realtime priority for this for example?
Please reply. Thanks in advance.

Hyun-jik Bae

Nov 10 '06 #2
Hello Hyun-jik Bae,

Just to add Ciaran's post:
GC pause nothing, it just ask CLR to suspend/resume threads.
It's not just simple suspension, there are some cases how threads are suspended
based on whether threads are in managed code or not

HI got a curiosity while using CLR.
HHow can it be done that accessing object data by CLR application is
Hsafe
Heven while garbage collector is working? Is the GC thread running in
Hrealtime priority for this for example?
HPlease reply. Thanks in advance.
HHyun-jik Bae
H>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Nov 10 '06 #3
I always thought that the GC will not collect managed resources when they
are in use and that's exactly what he is saying no? Unmanaged resources
that's a different story that's why we have GC.KeepAlive()

Gabriel Lozano-Morán

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
Hello Hyun-jik Bae,

Just to add Ciaran's post:
GC pause nothing, it just ask CLR to suspend/resume threads. It's not just
simple suspension, there are some cases how threads are suspended based on
whether threads are in managed code or not

HI got a curiosity while using CLR.
HHow can it be done that accessing object data by CLR application is
Hsafe
Heven while garbage collector is working? Is the GC thread running in
Hrealtime priority for this for example?
HPlease reply. Thanks in advance.
HHyun-jik Bae
H---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche


Nov 28 '06 #4

"Hyun-jik Bae" <im**********@hitel.netwrote in message
news:ev**************@TK2MSFTNGP03.phx.gbl...
>I got a curiosity while using CLR.
How can it be done that accessing object data by CLR application is safe
even while garbage collector is working? Is the GC thread running in
It isn't.... the gc moves everything. That's why the GC suspends all
threads in managed code before it starts running.
realtime priority for this for example?
Please reply. Thanks in advance.

Hyun-jik Bae

Dec 5 '06 #5
Hello Ben,

A small addition - GC calls functions to do the suspension and the resumption
as a service provided in the CLR.
It's the work of CLR and EE(Execution Engine) to manage this

BV"Hyun-jik Bae" <im**********@hitel.netwrote in message
BVnews:ev**************@TK2MSFTNGP03.phx.gbl...
BV>
>I got a curiosity while using CLR.
How can it be done that accessing object data by CLR application is
safe
even while garbage collector is working? Is the GC thread running in
BVIt isn't.... the gc moves everything. That's why the GC suspends
BVall threads in managed code before it starts running.
BV>
>realtime priority for this for example?
Please reply. Thanks in advance.
Hyun-jik Bae
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Dec 6 '06 #6

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

Similar topics

2
by: Peter Kwan | last post by:
Hi, I believe I have discovered a bug in Python 2.3. Could anyone suggest a get around? When I tested my existing Python code with the newly released Python 2.3, I get the following warning: ...
7
by: Oliver Walczak | last post by:
Dear List, Trying the following hack: >>> a = >>> for i in range(0,9999999): a.append(i) >>> del(a) Builds up a great list in memory and immediately deletes it. Unfortunately the task...
2
by: James S | last post by:
Hi, Basically I've been fighting with this code for a few days now and can't seem to work around this problem. Included is the output, the program I use to get this error and the source code for...
55
by: jacob navia | last post by:
Tired of chasing free(tm) bugs? Get serious about C and use lcc-win32. The garbage collector designed by Boehm is the best of its class. Very simple: #define malloc GC_malloc #define free(a)...
5
by: Bob lazarchik | last post by:
Hello: We are considering developing a time critical system in C#. Our tool used in Semiconductor production and we need to be able to take meaurements at precise 10.0 ms intervals( 1000...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
5
by: R. MacDonald | last post by:
Hello, all, I am currently working on a .Net (VB) application that invokes routines in unmanaged (Fortran) DLLs. The unmanaged routines then communicate with the .Net application by means of a...
8
by: Brian | last post by:
What's the best way to debug code that is being run during garbage collection? We are getting AccessViolationExceptions that seem to be happening during garbage collection. But when it hits the...
158
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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
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,...

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.