473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

avoid function collisions ?

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
4 1604

"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
Critical section

Apologies for my spelling.

john

Jul 19 '05 #3
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Will McGugan | last post by:
Hi, I'm accumulating a number of small functions, which I have sensibly put in a single file called 'util.py'. But it occurs to me that with such a generic name it could cause problems with...
3
by: Markus Dehmann | last post by:
I have a class "Data" and I store Data pointers in an STL set. But I have millions of inserts and many more lookups, and my profiler found that they cost a lot of runtime. Therefore, I want to...
6
by: Nels Olsen | last post by:
Our company is rewriting our product in .NET. The old product is in PowerBuilder, which is heavy on Hungarian notation. We are approaching the time where we have to finalize naming conventions for...
6
by: barcaroller | last post by:
I'm looking for a hash function (in C) that will convert a string of arbitrary length (but less than 1024 chars) to a reasonably-unique 16-bit short integer. Can anyone point me to such a hash...
6
by: barcaroller | last post by:
I couldn't find a message-digest newsgroup, so I posted here. I have a C function that converts a string of arbitrary length to a 32-bit hash value. I realize this is overkill but I used...
44
by: gokkog | last post by:
Hi there, There's a classic hash function to hash strings, where MULT is defined as "31": //from programming pearls unsigned int hash(char *ptr) { unsigned int h = 0; unsigned char *p =...
3
by: kj | last post by:
I would like to break down my stylesheets into a modules library, but I can't figure out how to solve the problem of avoiding namespace collisions for CSS classnames. What's considered "best...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
11
by: January Weiner | last post by:
Hello, I need to use a hashing function for relatively short strings (roughly 16 characters or less). The data that needs to be accessed via hash is just a simple int. I just need to look up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.