United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7127792 Add the ability to change an existing PeriodicTask's execution interval
JDK-7127792 : Add the ability to change an existing PeriodicTask's execution interval

Details
Type:
Enhancement
Submit Date:
2012-01-06
Status:
Resolved
Updated Date:
2013-06-26
Project Name:
JDK
Resolved Date:
2012-11-06
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs25
Fixed Versions:
hs25 (b09)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Java Flight Recorder and possibly other Hotspot sub-systems, must be able to change
a PeriodicTask's execution interval.

                                    

Comments
On 1/9/12 2:48 AM, David Holmes wrote:
> On 7/01/2012 1:59 PM, Paul Hohensee wrote:
>> Take a look at the repo at /java/east/u1/phh/jfr7/hotspot/.
>
> The task code is not written to be thread-safe. If someone has
> analysed this to ensure that everything works as they expect then they
> should at least update the comments to reflect that - and make it
> clear that absence of synchronization and lack of memory visibility
> will not cause problems.
>
> And I will insist that ping be renamed! unpark() captures the
> semantics exactly. It can be an instance method instead of static and
> just do the actual unpark(). It can be used by the stop() code as well.
                                     
2012-01-23
David, when talking about thread-safety. Are you talking about the code inside the tasks or the general handling of PeriodicTasks?
I'm considering modifying the PeriodicTask and handling in the WatcherThread by adding a lock that would control adding/removing of tasks as well as changing the time. 
An alternative would be to try to do it with CAS, but since we don't expect any contention here it seems like overengineering to me.
                                     
2012-09-28
I was referring to the thread-safety of the general handling of periodic tasks. There is/was code that relies on the fact that the task queue can't arbitrarily change after VM startup.
                                     
2012-10-01
URL:   http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/c284cf4781f0
User:  rbackman
Date:  2012-11-06 13:42:30 +0000

                                     
2012-11-06
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/c284cf4781f0
User:  amurillo
Date:  2012-11-09 19:30:16 +0000

                                     
2012-11-09



Hardware and Software, Engineered to Work Together