Click here to Skip to main content
15,894,546 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dispose Method [modified] Pin
Martin#30-Jul-07 5:20
Martin#30-Jul-07 5:20 
GeneralRe: Dispose Method Pin
Luc Pattyn30-Jul-07 6:26
sitebuilderLuc Pattyn30-Jul-07 6:26 
GeneralRe: Dispose Method Pin
Luc Pattyn13-Aug-07 1:53
sitebuilderLuc Pattyn13-Aug-07 1:53 
GeneralRe: Dispose Method Pin
Martin#13-Aug-07 2:15
Martin#13-Aug-07 2:15 
GeneralRe: Dispose Method Pin
Guffa30-Jul-07 22:09
Guffa30-Jul-07 22:09 
GeneralRe: Dispose Method Pin
Luc Pattyn30-Jul-07 22:49
sitebuilderLuc Pattyn30-Jul-07 22:49 
GeneralRe: Dispose Method Pin
Guffa2-Aug-07 7:47
Guffa2-Aug-07 7:47 
GeneralRe: Dispose Method Pin
Luc Pattyn2-Aug-07 8:23
sitebuilderLuc Pattyn2-Aug-07 8:23 
Hi Guffa,

we are not converging yet !

The GC is not looking at code. There is no point in trying to figure
out what each of the threads in a program is going to do in the future.
How would the GC deal with changes in program flow, loops, recursive methods,
etc etc? It is just impossible.

All the GC looks at is reachable data, everything it can reach (in the
way I explained before) is considered alive and will not be collected.

I must add one refinement, the one your latest example is abusing
(I did not run your example, I understood what you meant with it): the GC
does not follow weak references when looking for reachable objects. Hence,
if an object is only reachable through one or more weak references, but not
a single normal reference, it does not get marked as reachable, and hence:
- it is collectable
- it does not contribute to any more reachables (by the references it may be holding)

BTW: I have seen the actual code of several non-Microsoft GC implementations,
and read dozens of articles on it (also Microsoft's); so I am pretty sure about
the theory behind them; I also have no indication whatsoever that the GC in .NET
is completely different from all the others.


Guffa wrote:
Almost all optimising is done by the JIT compiler, so you should look at the actual code generated, not the IL code.


I would like to do that, have not done that so far. Two problems:
1. can you tell me the easiest way to do that (find the code, then watch it;
I am quite familiar with Intel assembly, I even write some occasionally,
and I used to watch it in VS 6, that's before .NET)
2. I am afraid it is more volatile now, the code may be different on different
runs due to whatever circumstances it takes into account; so it might be harder
to draw valid conclusions from it.

Greetings





GeneralRe: Dispose Method Pin
Guffa4-Aug-07 1:08
Guffa4-Aug-07 1:08 
GeneralRe: Dispose Method [modified] Pin
Luc Pattyn4-Aug-07 14:48
sitebuilderLuc Pattyn4-Aug-07 14:48 
GeneralRe: Dispose Method Pin
Luc Pattyn2-Aug-07 21:56
sitebuilderLuc Pattyn2-Aug-07 21:56 
GeneralRe: Dispose Method Pin
Guffa4-Aug-07 1:19
Guffa4-Aug-07 1:19 
AnswerRe: Dispose Method Pin
Karthi_jpk30-Jul-07 3:19
Karthi_jpk30-Jul-07 3:19 
AnswerRe: Dispose Method Pin
Scott Dorman31-Jul-07 14:29
professionalScott Dorman31-Jul-07 14:29 
GeneralRe: Dispose Method Pin
N a v a n e e t h31-Jul-07 18:21
N a v a n e e t h31-Jul-07 18:21 
GeneralRe: Dispose Method Pin
Scott Dorman31-Jul-07 19:43
professionalScott Dorman31-Jul-07 19:43 
QuestionConnecting to SQL Server through C#.net Pin
Saba0230-Jul-07 2:32
Saba0230-Jul-07 2:32 
AnswerRe: Connecting to SQL Server through C#.net Pin
originSH30-Jul-07 3:03
originSH30-Jul-07 3:03 
AnswerRe: Connecting to SQL Server through C#.net Pin
Karthi_jpk30-Jul-07 3:04
Karthi_jpk30-Jul-07 3:04 
GeneralRe: Connecting to SQL Server through C#.net [modified] Pin
originSH30-Jul-07 3:19
originSH30-Jul-07 3:19 
QuestionAnother instance of my program is already running? Pin
pmartike30-Jul-07 2:17
pmartike30-Jul-07 2:17 
AnswerRe: Another instance of my program is already running? [modified] Pin
Martin#30-Jul-07 2:22
Martin#30-Jul-07 2:22 
QuestionSMO Impersonation? Pin
NanaAM30-Jul-07 1:47
NanaAM30-Jul-07 1:47 
QuestionSir Who redirect Fonts from C:\WINDOWS\Fonts to my Sample Application ? Pin
CodeVarma30-Jul-07 1:37
CodeVarma30-Jul-07 1:37 
QuestionConverting numbers and run some math equations in C# Pin
guyav9930-Jul-07 1:36
guyav9930-Jul-07 1:36 

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.