HighTechTalks DotNet Forums  

CLR behavior about accessing data during garbage collection working

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss CLR behavior about accessing data during garbage collection working in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Hyun-jik Bae
 
Posts: n/a

Default CLR behavior about accessing data during garbage collection working - 11-10-2006 , 11:41 AM






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




Reply With Quote
  #2  
Old   
Ciaran O''Donnell
 
Posts: n/a

Default RE: CLR behavior about accessing data during garbage collection workin - 11-10-2006 , 12:18 PM






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:

Quote:
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





Reply With Quote
  #3  
Old   
Michael Nemtsev
 
Posts: n/a

Default Re: CLR behavior about accessing data during garbage collection working - 11-10-2006 , 01:17 PM



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

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



Reply With Quote
  #4  
Old   
Ben Voigt
 
Posts: n/a

Default Re: CLR behavior about accessing data during garbage collection working - 12-05-2006 , 05:56 PM




"Hyun-jik Bae" <imays_NOSPAM (AT) hitel (DOT) net> wrote

Quote:
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.

Quote:
realtime priority for this for example?
Please reply. Thanks in advance.

Hyun-jik Bae






Reply With Quote
  #5  
Old   
Michael Nemtsev
 
Posts: n/a

Default Re: CLR behavior about accessing data during garbage collection working - 12-06-2006 , 01:32 AM



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" <imays_NOSPAM (AT) hitel (DOT) net> wrote in message
BV> news:ev54sbOBHHA.4592 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
BV>
Quote:
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
BV> It isn't.... the gc moves everything. That's why the GC suspends
BV> all threads in managed code before it starts running.
BV>
Quote:
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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.