By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 817 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

avoid function collisions ?

P: n/a
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 ?
Thanks in advance,

Howie

Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"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
Jul 19 '05 #2

P: n/a
Critical section

Apologies for my spelling.

john

Jul 19 '05 #3

P: n/a
Howie wrote:
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.


That's basically what most GUI toolkits do: Each received event is put
into a queue with a time stamp of when it happened, and in the event
loop, the queued events are sent to their targets.

Jul 19 '05 #4

P: n/a
Thanks to you

John and Rolf,

@Rolf
Each function with timestamp and a special flag, to drop some
functions that should not be queued ?
Thanks,

Howie
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.