PostManagedEvent timing

I wanted to find out if postmanagedevent is received in the same order it is sent and it would appear it is. But there appears to be a max of 15 events that can be posted? I have the below code in RLP/.NET and I only ever receive 15 events.


	int i;
	for(i = 0; i<100000; i++) 
	{
		RLPext->PostManagedEvent(i);
	}


        static void RLP_RLPEvent(uint data, System.DateTime TimeStamp)
        {
            Debug.Print(data + " " + TimeStamp.ToString());
        }
/code]

output:
0 01/01/2009 00:01:02
1 01/01/2009 00:01:02
2 01/01/2009 00:01:02
3 01/01/2009 00:01:02
4 01/01/2009 00:01:02
5 01/01/2009 00:01:02
6 01/01/2009 00:01:02
7 01/01/2009 00:01:02
8 01/01/2009 00:01:02
9 01/01/2009 00:01:02
10 01/01/2009 00:01:02
11 01/01/2009 00:01:02
12 01/01/2009 00:01:02
13 01/01/2009 00:01:02
14 01/01/2009 00:01:02
15 01/01/2009 00:01:02

Yes on embedded system there will always be limits on everything.

Once they are consumed in .NET does that open up one more available? Is there any way to check if you are at the max and should wait?

I didn’t play with that feature yet. So this method/function does not block RLP code execution until managed handler is finished?

This queues a managed event to be sent to RLPEvent (not sent immediately).
It is a queue of size 16. when you read in C#, you can send more events from native code.
It is not intended to send many events every milli-second. This will slow everything down a lot.

And is there any way to check that it is full before sending it another event?

No. Usually they are read in CLR code ASAP. This is the same as regular InterruptPort events.
You can implement your own event queue and read them from C# periodically…

Good to know that! And how many events from InterruptPort can be stored at the same time? The number divided by minimum time needed to be spend in manage code event handler determins the freq of signal that can be decoded without PinCapture class (so core net mf)…

The manged event handler does not matter. It is a bit more complex.
From native code you can send several events up to a limit.
Then they are transferred to CLR as soon as it gets a chance to. There is no limit here.
This is done very well in NETMF. You will hardly miss any events.

and as soon as means after the rlp function returns? As what I’ve read, managed code blocks during an rlp call, is that correct?

It would mean that in one rlp call, you can only fire 15 events.

Yes, you have to return from RLP. They are transferred once the current thread is suspended voluntary of because of a switch.