Fast call-backs

What would be the best way to implement fast call-backs between a
Neutrino resource manager and a user application ? Are there other
ways than passing an event that could be faster but still clean ?

The Neutrino memory protection between each processes is slowing down
my application. I need to pass quickly from an ISR (in my resource
manager) to a user call-back function (in the application) with a
minimum of time-expensive context changes. Could shared memory help
me ?


Alexandre Cottinet
Software Developer


Sent via Deja.com http://www.deja.com/
Before you buy.

You give very little information as to what you try to acheive.
Maybe your problem lies in your architecture.

What would be the best way to implement fast call-backs between a
Neutrino resource manager and a user application ? Are there other
ways than passing an event that could be faster but still clean ?

The Neutrino memory protection between each processes is slowing down
my application.

I need to pass quickly from an ISR (in my resource
manager) to a user call-back function (in the application) with a
minimum of time-expensive context changes. Could shared memory help
me ?

Not if you don’t transfer any data.

At what rate are you ISR happening?


Alexandre Cottinet
Software Developer


Sent via Deja.com > http://www.deja.com/
Before you buy.

In article <8ln9k6$59v$1@inn.qnx.com>,
“Mario Charest” <mcharest@zinformatic.com> wrote:

You give very little information as to what you try to acheive.
Maybe your problem lies in your architecture.

The client registers a callback function to the driver (a pointer to
its handler). This function is called when an ISR happens.

Another way would be: the client registers an event that is delivered
each time an ISR happens but the process seems much longer to me.

At what rate are you ISR happening?

Around 10 kHz, 30 kHz maximum. (Running on a PII 233)

If the kernel is taking over 10 us to deliver an event (from a process
to another), it is using around 30% of the CPU load during peak periods
(30 kHz) only for this event. I’m wondering if there is a way of
reducing this load.


Alexandre Cottinet
Software Developer


Sent via Deja.com http://www.deja.com/
Before you buy.

“Alexandre Cottinet” <acottinet@my-deja.com> wrote in message
news:8lnd88$1kl$1@nnrp1.deja.com

In article <8ln9k6$59v$> 1@inn.qnx.com> >,
“Mario Charest” <> mcharest@zinformatic.com> > wrote:

You give very little information as to what you try to acheive.
Maybe your problem lies in your architecture.


The client registers a callback function to the driver (a pointer to
its handler). This function is called when an ISR happens.

The resmgr can’t do that unless the client is a dll.
You might want to look into turning your client into a dll.
(You said resmgr so I assume you are talking about nto).

If you are talking about QNX4 then it is possible to directly call
into another process. I don’t know the details myself but I know
it can be done. Note that I would go to great length to NOT do
that.

It’s very possible your callback will need some sort of data
protection (semaphores/mutex). It can get pretty messy if
your callback calls other function that are share by your
application. You will have to make sure they are all reentrant.
The data protection can represent as much overhead as the
context switch…

Another way would be: the client registers an event that is delivered
each time an ISR happens but the process seems much longer to me.

Yes.

At what rate are you ISR happening?

Around 10 kHz, 30 kHz maximum. (Running on a PII 233)

30KHz, I consider this fast :wink:

Do you need to transfer any data, or the client just need to
know that an ISR occured and it needs to know ASAP?

If the kernel is taking over 10 us to deliver an event (from a process
to another), it is using around 30% of the CPU load during peak periods
(30 kHz) only for this event. I’m wondering if there is a way of
reducing this load.

Have you consider upgrading to a faster machine to get rid of your worry.
Today computer are worth less then a few day’s work.


Alexandre Cottinet
Software Developer


Sent via Deja.com > http://www.deja.com/
Before you buy.

Alexandre Cottinet <acottinet@my-deja.com> wrote:

Around 10 kHz, 30 kHz maximum. (Running on a PII 233)

If the kernel is taking over 10 us to deliver an event (from a process
to another), it is using around 30% of the CPU load during peak periods
(30 kHz) only for this event. I’m wondering if there is a way of
reducing this load.

Do you need a POSIX interface? For instance, you could just write a
process that has multiple threads, one of which waits for hardware
interrupts and then signals another thread.

Have you profiled your code to see where the time is actually being eaten up?

Can you queue events? For example, if you buffered 5 events before sending
them off to the client then you could drastically reduce the overhead.

chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Embedded Software Design Engineer
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<