summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/buffer.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 8c805dfc..11506202 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * buffer.c (buffer_write): Comment out call to buffer_flush_available.
+ This should speed up buffering at the expense of a possible increase
+ in latency in flushing the data if inside a long-running thread.
+
2005-04-25 Paul Jakma <paul.jakma@sun.com>
* workqueue.{c,h}: Helper API for setting up and running queues via
diff --git a/lib/buffer.c b/lib/buffer.c
index 48fd35af..81cd0f2a 100644
--- a/lib/buffer.c
+++ b/lib/buffer.c
@@ -464,11 +464,16 @@ buffer_write(struct buffer *b, int fd, const void *p, size_t size)
{
ssize_t nbytes;
- /* Attempt to drain the previously buffered data? */
+#if 0
+ /* Should we attempt to drain any previously buffered data? This could help
+ reduce latency in pushing out the data if we are stuck in a long-running
+ thread that is preventing the main select loop from calling the flush
+ thread... */
if (b->head && (buffer_flush_available(b, fd) == BUFFER_ERROR))
return BUFFER_ERROR;
+#endif
if (b->head)
- /* Buffer still not empty. */
+ /* Buffer is not empty, so do not attempt to write the new data. */
nbytes = 0;
else if ((nbytes = write(fd, p, size)) < 0)
{