"Howie" <ho****@webb.de> wrote in message
news:4e********************************@4ax.com...
Hi,
we have an ActiveX Application with a 3D scene management.
During calculations in a function (foo1) wich is startet every
mousemove or mouseclick or by user who is click a button on a
html-panel, the foo1 ist startet again bevore the old foo1 is ready.
(event-driven ?).
I tried to stop another foo1 if an bool (as switch) is false. But then
i lost the user-button click, so i must stack all user-button clicks
an give them later on idle time.
How can i avoid such situation of collision functions ?
You need to use a technique called a critcal section. While one thread is
inside the critcal section, all other threads will wait until it leaves.
When it does leave one other thread will be permitted to enter the critcal
section.
But standard C++ has no support for crtical sections or any form of
threading at all (standard C++ is the topic of this newsgroup). You need to
ask in a Windows programming group, like
news:comp.os.ms-windows.programmer.win32 or you could just look up critical
section in MSDN.
john