|
C/C++
|
|
Local Links
|
|
Downloads
|
|
|
|
LibQuaker
This page contain information about the "Quaker" library. The library
provides some C++ classes, wrapping platform dependent aspects in classes
that are used to write platform independent multi-threaded programs.
Why the name Quaker ?
Something special to me. A Quaker is my pet. :-)
Sorry, that was the name that came to my mind.
Motivation
The mechanisms provided by this library have been used over the
years on many peojects that I have participated.
I have been rewriting them a few times to different customers,
on different occasions. So far, I had to rewrite them in a way or
the other becuase they eventually used proprietary code, that for a lot
of reasons, including contracting, could not be released.
The mechanisms, explained below, are very generic and they're available
in many forms, in different libraries around the Net. As you read through
them, you instantly associate them with something that you probably
wrote in the past.
Enough is enough. I guess it is time to write a clean-room implementation
and release them as open source, so next time I'll tell the customer:
"Look, we can save a lot of time if we use this open source package".
What it provides ?
-
Callbacks
This is a generic mechanism to provide a callback framework that can
be used from C++ programs. For more details about Callbacks, see this
page: Callbacks
-
Message Queue
This is a generic mechanism to provide a thread save queue. Many
RTOS have it as an API. Why not use it ? You can if you want to. :-)
The idea is to have a generic mechanism that is platform
independent and easy to understand from a C++ standpoint.
Most RTOS calls are C based and frequenly, they requires setting
many parameters per call.
-
Thread Library
After using many thread libraries, I've decided that this one from the
page:
OmniORB,
is the simpliest. Very small, portable and reliable.
Please, refer to the
Omni Threads Documentation
for a complete description of how to use the library.
-
Alarms
All OS/RTOS that I know of support them. So, you might be asking yourself,
why the hell this guy is providing this ?
Simple, the interface of these classes are C++ friendly. You
can easily use class members as callbacks to be invoked when the
alarms are fired.
There are support for one-shot and repeatable alarms.
In some cases it might be more convinient to use the OS native
alarms. One case is when you need higher resolution that the
one provided by the framework ( in seconds ).
-
Passive Timer
A very simple class to check for timeouts and/or measuring the duration
of an operation. It requires a free-running counter, and in most OS/RTOS
it uses the clock() function. The resolution is in milliseconds.
-
Sequencer
This class is rarely used, when you have a framework as omnithread
available. But, it can be useful when you need to off load to another
thread certain operations of one object. Sequencer is also very important
when you are implementing asynchronous operations.
-
Circular Queue
A templated based circular queue class.
I have not used this in years, since STL came out. But, it can be useful
sometimes.
-
Inter-Thread Communication - ITC
A C++ version of a "mailbox" mechanism available on some OS/RTOS. This
framework allows you to design "message based" mechanisms where threads in
the same address space use them to exchange messages.
The messages can be synchronous and asynchronous.
Platforms Supported
Documentation
Support
Support for this library as well as general C++ mentoring is available
on a contract basis.
Please, contact me at:
rdasilva@connecttel.com
for more information.
Missing features
-
Logging -- A syslog based class would be nice
-
Sockets wrapper -- A good socket class would be nice, although
I have seen many of them.
-
Serial port class -- A multiplatform abstraction of a serial port
is very interesting.
Download
callback-1.01.zip
Archive with source code and examples of the callback framework.
License
This framework is licensed under the LGPL. See arhive for details.
Visitors:
Last modified Mar 24, 2001
Copyright ©1999-2001 Rosimildo da Silva. All rights reserved.
|