2013/10/22 Philippe Gerum <r...@xenomai.org>

> On 10/22/2013 06:45 PM, Kim De Mey wrote:
>
>>
>>
>>
>> 2013/10/19 Ronny Meeus <ronny.me...@gmail.com
>> <mailto:ronny.me...@gmail.com>**>
>>
>>
>>
>>         IIUC, this would add the quite unexpected requirement of having
>>         to reopen a file for getting fresh data. read() should actually
>>         (re-)read the current object state each time it is invoked, and
>>         not resend some frozen state collected by the corresponding
>>         open() indefinitely.
>>
>>         e.g. this has to work with code like:
>>
>>                  fd = open("/mnt/xenomai/1235/foo/__**tasks", O_RDONLY);
>>
>>                  for (;;) {
>>                          ret = read(fd, buf, sizeof(buf));
>>                          ... process NEW data ...
>>                  }
>>
>>     Philippe,
>>     how to handle the case where the data is bigger than de buffer
>>     passed by the user?
>>     Suppose the task data is 20k while the user read only wants 4k. I
>>     would expect that the second read returns the second 4k block and so
>> on.
>>     By generating the complete output in 1 shot (for example at open),
>>     the data would be more consistent in my opinion too.
>>     Suppose the data of a queue is dumped and the queue contains a lot
>>     of messages. I would like to see a consistent view on the queue and
>>     not the first 4k followed by some random messages after it because
>>     the application is processing the queue in parallel.
>>
>> Philippe,
>>
>> As Ronny explains, the reason of "storing the state" at open is so that
>> the data we read would be consistent. So yes, I think we need this.
>>
>>
> I don't think so. Implementing a snapshot mechanism so that reading from a
> channel does return a consistent set of data does not mean that we should
> do this in open(). This only means that we should implement a snapshot
> mechanism for reading.
>

I meant that we need to be able to "store the state", not that we necessary
need to do it in the open(). My sentence was confusing, sorry. As I
explained further in my previous post we could do it in the initial read()
like it is done in sysfs for example.

Kim
_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to