multiProcess and multiThread via semphore bug

Hi all appreciate some help on this issue. Before I share the bug, let me give an overview of my program flow.

The assumption made here is, I'm using C programming and Win32 API for my work. No MFC or ATL etc..

the job of my Baseline.exe basically spawns a few Processes using CreateProcess() to call JobA.exe and JobB.exe. I use the CreateTimerQueueTimer()
to executes the routine that does ReleaseSemaphore() to my JobA.exe every 20ms and JobB.exe every 40ms. The synchronize mechanism involves 3 separate semaphore two for JobA.exe and one for JobB.exe every time when the Timer calls the routine to ReleaseSemaphore(). This is done to give the right synchronization rights to the right group of Jobs at the right timing.

In JobA.exe, it contains 2 Threads running 2 different functions every 20ms. This 2 functions is waiting for the semaphore release coming from Baseline.exe timer 20ms routine before printing text line. The JobB.exe contains only a single function running at 40ms.

Here is the Problem, after i let it run for around 10mins, my Baseline.exe printed Error message <298>. one of the thread in JobA.exe is not responding while the other thread is running follow by an error msg pop up warning JobA.exe has to shut down due to some error unknown. What could be the problem resulting this?

from Vin

Memory leak? have you tried running the programs with a debugger attached or through a profiler?
Topic archived. No new replies allowed.