i don't know enough about your 'sound meter', but if it is meant for a windows form, am i to believe it extends windows.form? if so, then each occurence of it should be a different thread. in fact, every time you use the keyword 'new', you start a new thread.
I also did a few tests like putting a sound meter into an infoinite oops - it crashes the whole prog. Any ideas. (Windows crtl - alt -del shows a constant 5 thread running too )
aah, well if it craches the whole prog then multiple thread wont help you (though they probably are running as seperate thread now, onlyless you were heavy on using 'static') - if one thread goes, it usually takes the program with it.
is it throwing exceptions, or just crashing because the tight loop is sucking up your resources?
if it's because of error/exceptions, try catching them. read the console output after the crash, it should have a record of the method statex. the first method from your app listed is usually the one that wants catching.
if the loop is too tight then control it with a timer to allow cpu space for other threads/progs.
Back to the thread issue - Are you saying that a new thread is created whenever using the "new keyword"? So making a new string object creates a new thread??????
What I know; a struct (int, string, double) are always on the stack. And an object (Form, String, Control) are always references to an object on the heap.
It doesn't have anything to do with threads...
keep an eye of how many threads you have running as you create a new object. new object, new thread. the whole point of high level oop is that every object looks after itself - that's why they get a new thread, a recognised existance by the os to allow an object to manage itself.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.