----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 11:29 PM
Subject: Potential New Package: Threading Goodies?


> Rummaging through my virtual attic (actually, the sources to what was
> going to be Apache JServ 2.0 before Tomcat came along), I've found a bunch
> of useful classes that assist in building multi-threaded applications --
> especially message passing and thread synchronization --
> which we do a lot of in Jakarta-land.  I was wondering if people thought
> this might be a useful package to consider for Commons.  If there's
> interest, I'll go pull the stuff out and check it into sandbox so we can
> take a look.
>
> The proposed package name would be "org.apache.commons.threading"..
>
> Included interfaces:
> * Notifier - Implements a background thread that delivers objects
>   to specified Subscribers
> * Publisher - Interface implemented by senders who want to send messages
>   to registered Subscribers
> * Queue - Generic message queue interface
> * Semaphore - Generic interface for objects that represent locks or
>   semaphores
> * Subscriber - Interface implemented by receivers who want to receive
>   messages sent by Publishers
>
> Included classes:
> * Alarm - Timer that publishes events in one of three modes:  continuous
>   (at regular intervals), multi-shot (fires once, but can be reused), and
>   one-shot (fires once, then destroys background thread)
> * AsynchPublisher - Publisher that uses a Notifier for delivery via a
>   shared or unshared background thread
> * Condition - Simple condition variable for use in flags like "queue
>   not empty"
> * Counter - Counting semaphore that can be used to suspend a receiver
>   until there is at least one object in a Queue
> * FIFONotifier - Implementation of Notifier that guarantees to deliver
>   notifications in the order received, with no dropped notifications
> * FIFOQueue - Implementation of queue with first-in/first-out semantics
> * LIFOQueue - Implementation of queue with last-in/first-out semantics
> * MultiSemaphore - Utility class for locking and unlocking multiple
>   semaphores at once
> * Mutex - Semaphore that can be locked by only one thread at a time
> * SynchPublisher - Publisher that uses the caller's thread for delivery
>
> NOTE:  A lot of these classes were inspired by an article series by Allen
> Holub called "Java Threads in the Real World", published in JavaWorld from
> September 1998 through April 1999.  I've used them in a variety of
> scenarios to good effect, and would like to see them available.
>
> Craig
>

+1

I think we can have as many of these in commons, that's fine. However there
*must* be someone responsible for make doing maintenance and them and making
them live. I also think it would be better if at least one project was using
any of the component we are bringing in ... otherwise there is a high risk
that they will never be used and that the commons will be big (excuse my
word) dump. I would prefer the commons to have less components and they be
useful and used rather than the other way round.

The real challenge now is to succeed in making other jakarta projects use
the commons ...

Vincent.

Reply via email to