(10) (M) RFR: 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems

David Holmes david.holmes at oracle.com
Sat May 20 13:07:26 UTC 2017


<dropping build-dev>

Hi Robbin,

On 19/05/2017 10:33 PM, Robbin Ehn wrote:
> Hi David
> 
> On 05/19/2017 01:36 PM, David Holmes wrote:
>>>
>>> There are three different forms of the calculation. The two relative 
>>> time versions use a different time function and so a different time 
>>> structure (timeval vs timespec) and a different calculation.
> 
> Yes that's why I included unit in my example signature.
> 
>>
>> It's more complicated than that because we may have build time 
>> SUPPORTS_CLOCK_MONOTONIC but we still need the runtime check as well.
>>
>> to_abstime is the old linux unpackTime with the addition of the build 
>> time conditionals.
> 
> I'm not changing that, I'm not sure how to explain better,
> so here is the patch (only compiled and silly naming convention):
> http://cr.openjdk.java.net/~rehn/8174231/webrev/

Thanks for the taking the time to do this.

> This makes the calculation independent of source/unit.

Okay I see. Took me a few read throughs to get the gist of it - and it 
helps to read from the bottom functions up :)

Not sure why you are returning a value from the functions though ??

Let's see what others think. It's somewhat harder to compare against the 
existing code.

Thanks again.
David

> Thanks!
> 
> /Robbin
> 
> 
> 
>>
>> David
>>
>>> David
>>> -----
>>>
>>>> I do not see a problem with this, only better readability?
>>>>
>>>> /Robbin
>>>>
>>>>>
>>>>> Thanks,
>>>>> David
>>>>> -----
>>>>>
>>>>>>       struct timespec now;
>>>>>>       int status = _clock_gettime(CLOCK_MONOTONIC, &now);
>>>>>>       assert_status(status == 0, status, "clock_gettime");
>>>>>>       calc_time(abstime, timeout, isAbsolute, now.tv_sec, 
>>>>>> now.tv_nsec, NANOUNITS);
>>>>>>    } else {
>>>>>> #else
>>>>>>    {
>>>>>> #endif
>>>>>>       struct timeval now;
>>>>>>       int status = gettimeofday(&now, NULL);
>>>>>>       assert(status == 0, "gettimeofday");
>>>>>>       calc_time(abstime, timeout, isAbsolute, now.tv_sec, 
>>>>>> now.tv_usec, MICROUNITS);
>>>>>>    }
>>>>>> #endif
>>>>>>
>>>>>> Thanks for fixing this!
>>>>>>
>>>>>> /Robbin


More information about the hotspot-dev mailing list