Board index » cppbuilder » Help with multi-threaded app freezing on SMP machines

Help with multi-threaded app freezing on SMP machines

Greetings all,

I'm having a horrible time trying to get our application to even launch when
installed on an SMP machine. Have confirmed that SMP is the issue by
starting a command-line session, setting the Affinity to use only 1 CPU and
launching the application, which works fine everytime. However, launching it
from the executable itself, maybe 1 in 15 or 20 tries will successfully
launch it, most other times it just starts a process under Task Manager and
sits there indefinetely. The application utilizes multiple TThreads
throughout, and I have noticed it doesn't utilize any TCriticalSections, nor
does it use the Synchronize() methods on the threads. My question is, is
this all that is required to be able to run the application on an SMP
machine? Are the multiple threads the issue, or is that a possible
red-herring? Any and all help or pointers (NULL or otherwise) greatly
appreciated!

Mr. D

 

Re:Help with multi-threaded app freezing on SMP machines


Definitely sounds like a multithreading problem. SMP machines are usually
where the multi-threading bugs really become evident. It sounds like you
have some sort of a deadlock occurring that is blocking the complete firing
up of the application except when the timing is perfect. Multithreaded apps
are a pain in the ass to troubleshoot. You are going to have to dive
headfirst into the code and try to determine everything that is going on at
initialization and then try to determine if things have to happen in a
certain order or if there is something that if it runs at the wrong time
could block the app.

As a general rule, I would say that an app that has thread functions coded
into it and it doesn't have critical sections, atomic operations, or other
syncronization functions probably is going to have issues.

--
---
Joe Richards
www.joeware.net
---
NEED TO GET CLEAR TEXT PASSWORDS ON NT OR WINDOWS 2000???
Go to www.joeware.net Products link and check out Grab Pass.
---
NEED TO LOCK DOWN THE BUILT-IN ADMIN ACCOUNT FROM PASSWORD CHANGES????
Go to www.joeware.net Products link and check out Secure500.
---

Quote
"MisterD" <mist...@spamcop.net> wrote in message news:3ba63fbc$1_1@dnews...
> Greetings all,

> I'm having a horrible time trying to get our application to even launch
when
> installed on an SMP machine. Have confirmed that SMP is the issue by
> starting a command-line session, setting the Affinity to use only 1 CPU
and
> launching the application, which works fine everytime. However, launching
it
> from the executable itself, maybe 1 in 15 or 20 tries will successfully
> launch it, most other times it just starts a process under Task Manager
and
> sits there indefinetely. The application utilizes multiple TThreads
> throughout, and I have noticed it doesn't utilize any TCriticalSections,
nor
> does it use the Synchronize() methods on the threads. My question is, is
> this all that is required to be able to run the application on an SMP
> machine? Are the multiple threads the issue, or is that a possible
> red-herring? Any and all help or pointers (NULL or otherwise) greatly
> appreciated!

> Mr. D

Re:Help with multi-threaded app freezing on SMP machines


Mr. D.

I have done several apps on WNT & W2K SPM machines. The only problem I
have had so far is with threaded timers such as the threaded timer with
the ziegler one package as well as alan garney's TThreaded timer. These
components work perfectly on a one-processor system but do very strange
things on an SMP.

I wrote about the problem to Claus Ziegler but he didn't have a duap
peocessor machint to test on so I gave up and am using multimedia
timers.

Tom Woodrow

Other Threads