On Sat, Dec 6, 2008 at 1:41 PM, Scott McKellar <[EMAIL PROTECTED]> wrote: > This patch tidies up a few things: > > 1. Corrected a few minor typos in the header. > > 2. Made the client_message_handler function static, since no other source > file references it by name. > > 3. Moved several things from the header to the implementation file, of > which all are internal details not referenced elsewhere: > > -- The macros MESSAGE_LIST_HEAD and MESSAGE_LIST_ITEM > -- The declaration for struct message_list_struct, along with the > associated typedefs
Applied, with more below. [snip] > > I propose the following changes: > > 1. Add a "next" pointer to the transport_message. The code in > transport_message.c will initialize it to NULL but otherwise ignore it. > > 2. Eliminate the dummy node. > > 3. In the transport_client, maintain two pointers: one to the head of > the queue and one to the tail. Then the time complexity of building a > queue with n nodes will be O(n). > > The last proposal is independent of the other two. It will make a > difference only for longish queues. I have no idea how long the queues > typically get, but I'm inclined to code for long queues. Short queues > will be fast enough no matter how you manage them. > > Give me the go-ahead and I shall prepare the patches accordingly. As it's transparent to the rest of the code, I say go. It gives me pause to conflate the individual messages with the message container, but code maintenance and performance improvements trump that IMO. --miker > > Scott McKellar > http://home.swbell.net/mck9/ct/ > > Developer's Certificate of Origin 1.1 By making a contribution to > this project, I certify that: > > (a) The contribution was created in whole or in part by me and I > have the right to submit it under the open source license indicated > in the file; or > > (b) The contribution is based upon previous work that, to the best > of my knowledge, is covered under an appropriate open source license > and I have the right under that license to submit that work with > modifications, whether created in whole or in part by me, under the > same open source license (unless I am permitted to submit under a > different license), as indicated in the file; or > > (c) The contribution was provided directly to me by some other person > who certified (a), (b) or (c) and I have not modified it; and > > (d) In the case of each of (a), (b), or (c), I understand and agree > that this project and the contribution are public and that a record > of the contribution (including all personal information I submit > with it, including my sign-off) is maintained indefinitely and may > be redistributed consistent with this project or the open source > license indicated in the file. -- Mike Rylander | VP, Research and Design | Equinox Software, Inc. / The Evergreen Experts | phone: 1-877-OPEN-ILS (673-6457) | email: [EMAIL PROTECTED] | web: http://www.esilibrary.com
