Flushing data in fifo

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Flushing data in fifo

Re: Flushing data in fifo

Post by support »

Hello,

The first question that comes to mind is why non-blocking mode isn't supported. You didn't mention which OS you're using. If it's Windows, it's indeed not supported.

However if you're using Linux, non-blocking read is supported for asynchronous streams. All streams except mem_8 in the demo bundle are asynchronous, so if you've running on your own custom IP core, make the relevant stream asynchronous (possibly by defining its use as data acquisition).

Non-blocking read doesn't make sense on a synchronous stream, because the whole point of a synchronous stream is that the data is fetched from its source only on demand.

The Xillybus host application programming guides in the documentation part of the website explain synchronous vs. asynchronous streams in section 2.

Regards,
Eli

Flushing data in fifo

Post by Guest »

Hi,

I am dealing with the fifo where I need to flush the data. If I use the read function to empty the pipe, since I do not know how many bytes in the fifo, my program will stuck in read function and will never return.

I tried to open the device in non-blocking mode - but it not supported.
I tried to use poll and select but it's not detecting if there's a data in the fifo.

I looked at the fifo.c example in demoapps but the way it works is that it holds the information (different threads) on how many bytes are being sent/read/delete.

Is there any other way around that I can use to clear my data?.

Thanks,

John

Top