Coder Social home page Coder Social logo

abstractlogger_dualringbuffer's Introduction

abstractlogger_dualringbuffer

Implementing an abstract logger, but adding a semi-unique twist with an interleaved ring buffer. Note: I have a massive headache, and am running on about 2 hours of sleep. I'm not sure how good this code is gonna be, but I'll get crackin' on it.

Correction: I am going to bed, as the screen is now blurry.

** Back from the migraine ** So, what this is: A] Simple logger utilizing a vtable for an abstracted interface B] This logger utilizes a dual ring buffer with statically allocated memory. The reason for using dual ring buffers, is so that multiple-write/single read latencies can (at least its my belief) be minimized. C] Proof of concept code

A dual ring buffer... why? Is two really better than one? I don't know, but I'll find out shortly. Here's my thought process: Given that you have multiple processes writing to a single logging "pipe," placing the logged messages into a buffer for future processing makes sense. I chose a ring buffer with statically allocated elements, so that I can simply memcpy the log structure that has been passed in from the logging interface.

	The potential issue that I see, is that with a single ring buffer, ultimately the writing
	processes are gated by the single reading process. My theory, is that by having two ring
	buffers that are written to, the writers are less likely to be gated by the reading/processing
	process.
	
	My initial plan is to utilize semaphores instead of mutexes, but this may change.

Building this project: This project utilizes automake. After pulling down the source, insure that automake and friends is installed. Type the following commands: ./configure make make install

abstractlogger_dualringbuffer's People

Contributors

turtleberry avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.