commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: [lang] or [ThreadPool] contribution: ParalellThreadGuard
Date Fri, 17 Oct 2003 14:45:44 GMT

So this is kind of like the Sync implementations in Doug Lea's
util-concurrent package?
tro.html)  I ask because the above package will be java.util.concurrent
in JDK 1.5.  So if commons-lang wants to have something similar for
earlier JDK versions, it'd be nice if the names matched ;)

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: []
>Sent: Friday, October 17, 2003 10:29 AM
>To: Jakarta Commons Developers List
>Subject: [lang] or [ThreadPool] contribution: ParalellThreadGuard
>A common problem for networked applications accepting multiple
>connections in individual threads that cannot control the
>socket accept() paralellity (as the JDK1.4 ORB) need to restrict
>the resources somewhere else.
>For this purpose we designed a ParalellThreadGuard class that
>can be used as follows:
>   private ParalellThreadGuard guard =
>     new ParalellThreadGuard(THREADS_ACTIVE, THREADS_ENQUEUE,
>   public void guardedMethod() throws RejectedException
>   {
>     guard.register(); // might throw a RejectedException
>     try
>     {
>       ... // do something with your limited resources here
>     }
>     finally
>     {
>       guard.release();
>     }
>   }
>This class seems to fit to the [lang] area, but might also
>fit in the scope of the sandboxed [ThreadPool] package.
>I can contribute it to Apache with the proper licence header
>if someone sees it fitting.
>Christoph Reck

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message