Click here to Skip to main content
15,893,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: I need to explain to our VP why trying to do everything in Stored Procedures is a bad idea Pin
PIEBALDconsult5-Aug-08 3:24
mvePIEBALDconsult5-Aug-08 3:24 
GeneralRe: I need to explain to our VP why trying to do everything in Stored Procedures is a bad idea Pin
Ashfield5-Aug-08 8:26
Ashfield5-Aug-08 8:26 
GeneralRe: I need to explain to our VP why trying to do everything in Stored Procedures is a bad idea Pin
Guffa4-Aug-08 21:42
Guffa4-Aug-08 21:42 
GeneralRe: I need to explain to our VP why trying to do everything in Stored Procedures is a bad idea Pin
PIEBALDconsult5-Aug-08 3:26
mvePIEBALDconsult5-Aug-08 3:26 
GeneralRe: I need to explain to our VP why trying to do everything in Stored Procedures is a bad idea Pin
nelsonpaixao5-Aug-08 13:32
nelsonpaixao5-Aug-08 13:32 
QuestionHow to finalize an object with an internal Thread ? Pin
ofeririko4-Aug-08 11:38
ofeririko4-Aug-08 11:38 
AnswerRe: How to finalize an object with an internal Thread ? Pin
led mike4-Aug-08 12:09
led mike4-Aug-08 12:09 
AnswerRe: How to finalize an object with an internal Thread ? Pin
Guffa4-Aug-08 12:32
Guffa4-Aug-08 12:32 
ofeririko wrote:
I created a instance of this class and I've noticed that the internal Thread keeps running after the class instance goes out of scope.


Yes, mainly for two reasons.

1. A thread doesn't die just because there is no reference to it's class. It's referencing the class itself, so it's not going to be garbage collected.

2. Nothing happens to the object when the variable referencing it goes out of scope. Absolutely nothing. When an object becomes unreachable it's up for garbage collection, but the garbage collector doesn't care about scope at all, only usage. The concept of scope is only relevant to the compiler.

ofeririko wrote:
I can see that the only way to stop the Thread is to implement a "public Teminate()" method that kills the Thread.


The well behaved way of stopping a thread is to tell it to stop, and let it exit out of it's main method by itself. Changing the value of a volatile variable that the thread is polling, is one way of doint that.

ofeririko wrote:
I wanted to implicity shut down the internal Thread so I tried to implement Finalizer. this didnt work for me - the Internal thread kept running and the Finalizer never called


Of course not, the Finalizer is only called once the garbage collector notices that the object is up for garbage collection, but as the thread is referencing the object, it never will be.

If you want to control the life cycle of an object, you should implement the IDisposable interface.

Despite everything, the person most likely to be fooling you next is yourself.

Questionobject oriented(class inheritance)??????? Pin
mr.mohsen4-Aug-08 10:57
mr.mohsen4-Aug-08 10:57 
AnswerRe: object oriented(class inheritance)??????? Pin
DaveyM694-Aug-08 11:03
professionalDaveyM694-Aug-08 11:03 
AnswerRe: object oriented(class inheritance)??????? Pin
DaveyM694-Aug-08 11:08
professionalDaveyM694-Aug-08 11:08 
AnswerRe: object oriented(class inheritance)??????? Pin
CodingYoshi4-Aug-08 12:37
CodingYoshi4-Aug-08 12:37 
QuestionModify a file with a write only lock Pin
StevenWalsh4-Aug-08 10:38
StevenWalsh4-Aug-08 10:38 
AnswerRe: Modify a file with a write only lock Pin
Paul Conrad4-Aug-08 10:43
professionalPaul Conrad4-Aug-08 10:43 
QuestionTrying to set the printer in printdialog Pin
baranils4-Aug-08 10:33
baranils4-Aug-08 10:33 
QuestionPDF Library Pin
CodingYoshi4-Aug-08 10:18
CodingYoshi4-Aug-08 10:18 
AnswerRe: PDF Library Pin
Pete O'Hanlon4-Aug-08 10:27
mvePete O'Hanlon4-Aug-08 10:27 
GeneralRe: PDF Library Pin
Paul Conrad4-Aug-08 10:41
professionalPaul Conrad4-Aug-08 10:41 
GeneralRe: PDF Library Pin
Pete O'Hanlon4-Aug-08 10:45
mvePete O'Hanlon4-Aug-08 10:45 
GeneralRe: PDF Library Pin
Paul Conrad4-Aug-08 10:49
professionalPaul Conrad4-Aug-08 10:49 
GeneralRe: PDF Library Pin
CodingYoshi4-Aug-08 12:30
CodingYoshi4-Aug-08 12:30 
GeneralRe: PDF Library Pin
ramyanaidu4-Aug-08 17:56
ramyanaidu4-Aug-08 17:56 
QuestionImage Path From Image List Pin
vayanan4-Aug-08 8:08
vayanan4-Aug-08 8:08 
AnswerRe: Image Path From Image List Pin
C1AllenS4-Aug-08 8:52
C1AllenS4-Aug-08 8:52 
GeneralRe: Image Path From Image List Pin
User 66584-Aug-08 9:19
User 66584-Aug-08 9:19 

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.