[twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
Hello, I have a very difficult bug: the program includes lots of critical sections and it suddenly stops responding! I have a wrapper global function called lockCriticalSection(TCriticalSection *cs) which calls acquire. I want to log inside this but need to record the call stack so that I can see

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Francois PIETTE
I think JCL or JVCL has a function for call stack. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Fastream Technologies" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, Apr

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Arno Garrels
Fastream Technologies wrote: > Hello, > > I have a very difficult bug: the program includes lots of critical > sections and it suddenly stops responding! Sounds like deadlock. > I have a wrapper global > function called lockCriticalSection(TCriticalSection *cs) which calls > acquire. I want to l

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
This sounds reasonable. Can you give an example? Since all my cs are of TCriticalSection type, can I do it in this function: void __fastcall lockCriticalSection(TCriticalSection *CS) { // currently it is: CS->Acquire(); // what should it be? } Best Regards, SZ On 4/28/07,

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Arno Garrels
Fastream Technologies wrote: > This sounds reasonable. Can you give an example? Since all my cs are > of TCriticalSection type, can I do it in this function: I thought of using mutexes. That's not very difficult to change. Have an array of mutex handles, then pass the index to your function. Searc

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
Arno, I have THOUSANDS of critical sections passed to this function as parameter! Isn't there a simpler way to implement?? Regards, SZ On 4/28/07, Arno Garrels <[EMAIL PROTECTED]> wrote: > Fastream Technologies wrote: > > This sounds reasonable. Can you give an example? Since all my cs are > >

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
For example, perhaps we can implement a single global mutex for the lock... function. This would slow down the execution for sure but would it create the exception? Can you provide some source code snippet for this please? Best Regards, SZ On 4/28/07, Fastream Technologies <[EMAIL PROTECTED]> wr

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Arno Garrels
Fastream Technologies wrote: > Arno, > > I have THOUSANDS of critical sections passed to this function as > parameter! Why do you need THOUSANDS of critical sections?? That sounds slower than running single threaded. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html >

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Arno Garrels
Fastream Technologies wrote: > For example, perhaps we can implement a single global mutex for the > lock... function. No good idea. That would change a lot. > This would slow down the execution for sure but > would it create the exception? You have to raise the exception if the wait returns WA

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
Hello Arno, Per your advice, I coded the following but in the first time there needs to be a wait for other thread, it times out! I wonder why? void inline __fastcall lockCriticalSection(TCriticalSection *criticalSection) { HANDLE hMutex; // Create a mutex with no

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Markus Humm
Hello, did you already try MadExcept? Afaik it comes with source or at least can be bought with it and will decipher the callstack. It's free to use for non commercial projects AFAIK. Greetings Markus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.e

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
Hello, So this is my latest code: void inline __fastcall lockCriticalSection(TCriticalSection *criticalSection) { for(int i = 0; i < 5000; ++i) { if(criticalSection->TryEnter()) return;

Re: [twsocket] How to get the call stack programmatically?

2007-04-28 Thread Fastream Technologies
Yes, but the problem is there is exception thrown! I thought I wrote this before... On 4/28/07, Markus Humm <[EMAIL PROTECTED]> wrote: > Hello, > > did you already try MadExcept? Afaik it comes with source or at least > can be bought with it and will decipher the callstack. It's free to use > for