10-30-2009 09:55 PM - edited 10-30-2009 09:56 PM
I am confused about the use of nonblocking FSL in C programs. Why do we need a nonblocking FSL? For example, in the code below, I think we need to use blocking FSL.
//do square root
if we should use blocking FSL here, then my question is what happens if we use nonblocking FSL? Can you come up with an example that nonblocking FSL is useful (or preferred)?
10-31-2009 02:58 AM
There is a function to see if the non-blocking FSL operation was succesful or not. Can't check it up since I'm home right now.
You should find them in the manuals on the standalone libraries.
Non-blocking is used when you don't want to stall MicroBlaze until the FSL operation can be performed.
Ex. You are receiving data from two FSL inputs but you don't know which arrives first.
Instead of blocking on the first FSL port, you can check each of them in turn for results.
Before we added extended FSL operation functionality, non-blocking was the only way to handle interrupts while doing FSL operation, now FSL operation can be interruptable.
10-31-2009 01:52 PM
Goran is right, there are actually 4 flavors of FSL operations:
* Blocking and non-blocking:
Blocking are synchronous, and will return when the operation (put/get) is complete. Non-blocking operations can fail (if the FSL is full or empty) and the status of the operation must be checked in order to ensure that the FSL operation completed. Non-blocking operations are useful when trying to poll FSLs.
* Interruptible, and non-interruptible:
Interruptible FSL operations allow the processor to respond to asynchronous external interrupt events. Non-interruptible are atomic, and cannot be interrupted by external interrupts. If you aren't using interrupts, these differences will not affect you.