commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Created: (LANG-560) New TimedSemaphore class
Date Wed, 02 Dec 2009 20:44:21 GMT
New TimedSemaphore class
------------------------

                 Key: LANG-560
                 URL: https://issues.apache.org/jira/browse/LANG-560
             Project: Commons Lang
          Issue Type: New Feature
            Reporter: Oliver Heger
             Fix For: 3.0


{{TimedSemaphore}} is a specialized Semaphore implementation that also has a timing component:
In a configurable time period a given number of permits is available. Threads call the semaphore's
{{acquire()}} method to request a permit. When no more permits are available {{acquire()}}
blocks the calling thread. At the end of the time period the permits are restored, and all
blocking threads are waked up.

The main use case for this class is to provide a convenient means for controlling the load
produced by a process. When used correctly, {{TimedSemaphore}} ensures that only a given number
of steps (e.g. database queries, file operations, or computations) are performed in a specific
time period. This may be useful for many applications.

More information including a usage example can be found in the Javadocs of the class. Comments
or suggestions for improvements are appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message