Is it a good idea to replicate syscall.Gettimeofday and syscall.DecodeBintime in C ? Also I ...
13 years, 5 months ago
(2011-11-03 08:26:39 UTC)
#2
Is it a good idea to replicate syscall.Gettimeofday and syscall.DecodeBintime in
C ? Also I couldn't find any users for runtime.gettime.
Maybe you could use Tos.clock or Tos.pcycles (by declaring 'extern Tos *_tos;'
runtime/plan9/thread.c already uses it to read it's pid).
Please do not use the RDTSC instruction as a proxy for gettimeofday. It will not ...
13 years, 5 months ago
(2011-11-03 10:06:01 UTC)
#3
Please do not use the RDTSC instruction as a proxy for gettimeofday. It will not
work in a multi core world.
Sent from my iPhone
On 03/11/2011, at 20:22, Anthony Martin <ality@pbrane.org> wrote:
> paulzhol@gmail.com once said:
>> Is it a good idea to replicate syscall.Gettimeofday
>> and syscall.DecodeBintime in C ? Also I couldn't find
>> any users for runtime.gettime.
>
> src/pkg/runtime/runtime.c:/nanotime is the only
> function that calls gettime. Nanotime is used
> for the GC stats and Russ has a pending CL that
> changes time.Nanosleep to use runtime·nanotime
> directly. My plan is to remove Gettimeofday
> from the syscall package after that CL goes in.
>
>
>> Maybe you could use Tos.clock or Tos.pcycles (by
>> declaring 'extern Tos *_tos;' runtime/plan9/thread.c
>> already uses it to read it's pid).
>
> Neither of those will work but I could probably
> use tos.cyclefreq in combination with the RDTSC
> instruction although I would need some way of
> getting the epoch offset. Thoughts?
>
> Thanks,
> Anthony
On Thu, Nov 3, 2011 at 11:22 AM, Anthony Martin <ality@pbrane.org> wrote: > Neither of ...
13 years, 5 months ago
(2011-11-03 13:26:22 UTC)
#4
On Thu, Nov 3, 2011 at 11:22 AM, Anthony Martin <ality@pbrane.org> wrote:
> Neither of those will work but I could probably
> use tos.cyclefreq in combination with the RDTSC
> instruction although I would need some way of
> getting the epoch offset. Thoughts?
Windows' gettime uses QueryPerformanceCounter (I'm not sure, but it is
sounds like the equiv. to RDTSC) without calculating epoch, only for
delta as hector noted.
Can't we do the same with tos->pcycles and ask Russ to move Nanotime
to syscall ?
How frequent runtime.gc gets invoked ? Maybe you could cache the file
descriptor of /dev/bintime to save the open syscall - it was on my
TODO for syscall.Gettimeofday.
Pavel
On Thu, Nov 3, 2011 at 09:26, Pavel Zholkover <paulzhol@gmail.com> wrote: > How frequent runtime.gc ...
13 years, 5 months ago
(2011-11-03 13:36:36 UTC)
#5
On Thu, Nov 3, 2011 at 09:26, Pavel Zholkover <paulzhol@gmail.com> wrote:
> How frequent runtime.gc gets invoked ? Maybe you could cache the file
> descriptor of /dev/bintime to save the open syscall - it was on my
> TODO for syscall.Gettimeofday.
I plan to use this as the implementation of time.Nanoseconds.
It needs to be correct.
Russ
http://codereview.appspot.com/5327063/diff/22001/src/pkg/runtime/plan9/thread.c File src/pkg/runtime/plan9/thread.c (right): http://codereview.appspot.com/5327063/diff/22001/src/pkg/runtime/plan9/thread.c#newcode91 src/pkg/runtime/plan9/thread.c:91: // TODO(ality): fast, accurate clocks on Plan 9 or ...
13 years, 4 months ago
(2011-11-08 20:54:58 UTC)
#12
Issue 5327063: code review 5327063: runtime: add nanotime for Plan 9
(Closed)
Created 13 years, 5 months ago by ality
Modified 13 years, 4 months ago
Reviewers:
Base URL:
Comments: 4