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

2007-04-30 Thread Dave Baxter
MadExcept does similar things. http://www.madshi.net/madExceptDescription.htm Very useful, to users of Delphi 4-7 that is, not other versions, or C etc. Dave B. This mail has been scanned by Palmer Cook Computer Services Limited. www.palmercook.co.uk -- To unsubscribe or change your

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

2007-04-30 Thread Markus Humm
Hello, MadExcept does work also with Delphi 2005 and 2006 (and I suppose 2007). Greetings Markus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be

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

2007-04-29 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-29 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 non

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

2007-04-29 Thread Arno Garrels
Fastream Technologies wrote: Hello, So this is my latest code: void inline __fastcall lockCriticalSection(TCriticalSection *criticalSection) { for(int i = 0; i 5000; ++i) { if(criticalSection-TryEnter()) return; Calling Sleep() in such short intervals is critical. With each call to

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

2007-04-29 Thread Markus Humm
Hello, what I meant by mentioning MadExcept: it contains the source code to determine the call stack. This you could extract from madExcept and call it whenever you like. No need to raise some exception first! The full version of the FastMM memory manager contains similar code. Greetings

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

2007-04-29 Thread Fastream Technologies
Hello Markus, Unfortunately I was not able to detect when a deadlock occurs so as to launch the function you mention. Let's see if Arno's code will do the trick... Best Regards, SZ On 4/29/07, Markus Humm [EMAIL PROTECTED] wrote: Hello, what I meant by mentioning MadExcept: it contains the

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 twsocket@elists.org Sent:

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 log

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. Search

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 of

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]

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

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

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