From owner-cvs-all@FreeBSD.ORG Fri Feb 10 18:18:48 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C776716A420; Fri, 10 Feb 2006 18:18:48 +0000 (GMT) (envelope-from mux@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC9F343D62; Fri, 10 Feb 2006 18:18:47 +0000 (GMT) (envelope-from mux@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k1AIIlbh033500; Fri, 10 Feb 2006 18:18:47 GMT (envelope-from mux@repoman.freebsd.org) Received: (from mux@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k1AIIlr9033499; Fri, 10 Feb 2006 18:18:47 GMT (envelope-from mux) Message-Id: <200602101818.k1AIIlr9033499@repoman.freebsd.org> From: Maxime Henrion Date: Fri, 10 Feb 2006 18:18:47 +0000 (UTC) To: projects-committers@FreeBSD.org, cvs-projects@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: projects/csup config.h detailer.c lister.c main.c mux.c mux.h proto.c stream.c stream.h updater.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 18:18:48 -0000 mux 2006-02-10 18:18:47 UTC FreeBSD projects repository Modified files: csup config.h detailer.c lister.c main.c mux.c mux.h proto.c stream.c stream.h updater.c Log: - Change the stream API so that a stream is associated with a void *, rather than with an int. This changes the type of the read/write/close functions of the stream API. - Have a stream_open_fd() function to replace stream_fdopen() and new convenience functions for handling file descriptors : stream_read_fd(), stream_write_fd() and stream_close_fd(). - Have stream_fileno() that will return the file descriptor associated with the stream or -1 if it's not associated with any. - There is now a stream_open() funtion which is the most generic way to open a stream, associating it with a void *. - Inspect the open() flags in stream_open_file() to only create the necessary buffers. - Automatically connect the channel 0 in mux_init(), like CVSup, and get rid of the now useless chan_open() function. - Create the channel if it doesn't exist in chan_get(). - Now that I can, change the multiplexer API so that chan_connect() and chan_accept() return a struct chan * and not an id. Thanks to this, we now don't pass an ID but a struct chan * to the following functions: chan_read(), chan_write(), chan_close() and chan_wait(). This means that for each of these functions, we now spare a mutex lock and unlock and also reduce contention on the multiplexer lock. - Because of the previous change, use the new stream_open() in the worker threads to bind the channel to the chan_read() and chan_write() functions. - Optimize the scheduling of the sender thread by restarting the scan at the last channel + 1. This avoids starving high id channels with low id channels. That's a quite successful hacking night :-). Revision Changes Path 1.29 +3 -2 projects/csup/config.h 1.38 +5 -3 projects/csup/detailer.c 1.23 +3 -2 projects/csup/lister.c 1.31 +5 -3 projects/csup/main.c 1.60 +65 -51 projects/csup/mux.c 1.20 +11 -10 projects/csup/mux.h 1.63 +21 -24 projects/csup/proto.c 1.51 +126 -27 projects/csup/stream.c 1.21 +15 -7 projects/csup/stream.h 1.69 +3 -2 projects/csup/updater.c