On Thu, Jun 06, 2019 at 09:23:12PM +0200, Gustaf Neumann wrote:

> The main question is, why are you interested in async writes?

My original use case wasn't clear?  I have one thread busy processing
data and sending it various places.  I want to log some of that data
to a bunch of files, probably 10 to 100 different small files at any
given time.  Each write is only a small amount of data, but for easier
use later I'd rather keep the data organized into separate files,
rather than e.g. dump it all into one great big file.

The easiest thing to do is call Tcl's open, puts, close every single
time I need to write data, but that's blocking, and I'm worried that
it could easily degrade the latency of my main processing thread.  I
don't necessarily need async IO to the files, but I WOULD like to get
the latency of writing the files out of the main thread.

If I create my own writer thread for this, it could do the writes
synchronously (blocking), that would still accomplish my main goal of
getting the file write latency out of my main thread.

However, (particularly given my small writes to many files), clearly
asynchronous file IO should be more efficient, and scale better, so
I'd like to understand how to do that.  The ease of simply calling
"fconfigure" on a file handle is attractive, but I don't yet
understand what else I'd need to do to make that seemingly simple
approach actually work in the NaviServer context.

-- 
Andrew Piskorski <a...@piskorski.com>


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to