I’m trying to sample signals in a high rate and send values via network,
in order to achieve better results than in the managed code considering the following
register to interrupts in RLP share data buffer between the RLP and managed code, RLP will add values while manged will read buffer and send over network.
Can RLP and manged share same data?
Is there a way to use same lock for RLP and manged change buffer data should be in a critical section which both RLP and manged should access is this possible?
Another option is to send the data to the network via RLP is this possible?
Thanks.
You might need to be careful with this, while this is true you should not rely on this beyond the lifetime of the call to the RLP function. If the RLP function stores that pointer and uses the same pointer later in some other piece of code, like a native interrupt handler or another RLP function etc, the GC might have relocated the original buffer in the meantime.
There are no threads in RLP, at least that I’ve ever seen implemented. There are interrupts, but only one can be executing at a time.
AVR is the microcontroller used by Arduino (up until the DUE). It performs much better doing some sorts of things, because there’s no managed code. My statement was a bit tongue-in-cheek.
One of my goals is to create an actual OutputCompare native implementation and associated C# class. There’s no reason it needs to block like the current class does. Just pass it a list of timings and let the ISR handle the work.
I assumed there were threads in RLP (relying on a dicussion here: http://www.tinyclr.com/forum/topic?id=8853 )
and wanted to call teh managed code from another thread in RLP.
I’m trying to do the same, just read the pin instead of writing to it (and bettter get interrupt on value change). but I really don’t want all my code to be in RLP so trying a way to do this together. the managed code perfomance is not good enough for my needs. therefore I’m trying to find a solution using RLP. [line]Any suggestions?, is something like what I’m aiming to possible?
Edit: I am already using Interrupt port in managed but I want better Performance
PinCapture should be quite similar. You’ll need to understand timers, interrupts, and input capture, but essentially you’re going to build a list of timings in RLP and then raise an event when you’re done, and then call into the RLP from managed code to retrieve the timings.