Re: "write()" semantics



On 06/13/2011 02:51 PM, Don Y wrote:
Hi,

[I have nothing at all like a POSIX API! :> ]

My "write()" semantics essentially say, "Once invoked,
you forfeit the contents of 'buffer[]' -- even in asynchronous
mode."

This makes it a lot easier for my OS to move data around
as *it* sees fit. And, imposes minimal constraints on the
caller.

In "write()"'s case, it just means you *use* the buffer[]
contents, if necessary, *before* "write()"-ing them!

But, this means I can't take advantage of true parallelism
and/or I/O device scheduling delays. E.g., I can't start
an async write, get things enqueued for processing, and
*then* do a few last minute things with buffer[].

There is some cost to adding this support -- though I think
I already have most of the mechanisms necessary to do so in place.

So, the question is, how do *you* use write() and the data it
is called upon to process? E.g., if the de rigeur form is:

while (ALWAYS) {
...
fill(buffer);
...
write(buffer, device, mode);
}

then you *don't* need this proposed functionality.

Well, if I read your semantics correctly and unwind that loop, I get

fill(buffer) // with stuff to write it
....
write(buffer, device, mode); // write it
....
fill(buffer) // Aw crap!!

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html
.



Relevant Pages

  • Re: FPGA to PHY/MAC chip
    ... end up with these gawdaful state machines that grow without bound, ... Wescott Design Services ... semantic argument, but when you start applying large amounts of semantics to a project, it makes sense. ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.arch.fpga)
  • Re: Sample data log code for DSP?
    ... One often needs multiple tries to get the right answer -- one of the things one learns from newsgroups is how ambiguous any written language really is. ... Most manufacturers put all that sort of data up on their sites, so if Richard's suggestion hasn't lead you to it a good swing through the mfgr. ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.dsp)
  • Re: PLD suggestions for classroom use
    ... As the class size has outgrown my Spartan boards and I feel that a ... modern FPGA is overkill for the simple circuits they are building, ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.arch.fpga)
  • Re: error detection rate with crc-16 CCITT
    ... dynamically determine the fastest baud rate we can use by checking the ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (comp.arch.embedded)
  • Re: West African AIDS sufferer accuses Dominique Strauss-Kahn of rape!
    ... A woman who doesn't fight hard enough is complicit in her own rape? ... So, he's been accused of rape, he's a reasonable to extreme flight risk, and the DA is asking for no bail. ... Wescott Design Services ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (rec.crafts.metalworking)