diff mbox

[API-NEXT,v3] doc/users-guide: add time API section

Message ID 1450873921-16505-1-git-send-email-ivan.khoronzhuk@linaro.org
State Superseded
Headers show

Commit Message

Ivan Khoronzhuk Dec. 23, 2015, 12:32 p.m. UTC
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 doc/users-guide/users-guide.adoc | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

Comments

Bill Fischofer Dec. 23, 2015, 1:24 p.m. UTC | #1
On Wed, Dec 23, 2015 at 6:32 AM, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org
> wrote:


> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  doc/users-guide/users-guide.adoc | 29 ++++++++++++++++++++++++++++-

>  1 file changed, 28 insertions(+), 1 deletion(-)

>

> diff --git a/doc/users-guide/users-guide.adoc

> b/doc/users-guide/users-guide.adoc

> index 7ec7957..e8465d0 100644

> --- a/doc/users-guide/users-guide.adoc

> +++ b/doc/users-guide/users-guide.adoc

> @@ -197,7 +197,7 @@ precise syntax and semantics of each API.

>  ODP programs are built around several conceptual structures that every

>  application programmer needs to be familiar with to use ODP effectively.

> The

>  main ODP concepts are:

> -Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Timer,

> +Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Time,

> Timer,

>  and Synchronizer.

>

>  === Thread

> @@ -305,6 +305,33 @@ or may represent a device attached via a PCIE or

> other bus.

>

>  PktIOs are represented by handles of abstract type +odp_pktio_t+.

>

> +=== Time

> +The time API is used to measure time intervals and track time flow of an

> +application and presents a convenient way to get access to a time source.

> +The time API consists of two main parts: local time API and global time

> API.

> +

> +==== Local time

> +The local time API is designed to be used within one thread and can be

> faster

> +then the global time API. The local time API cannot be used between

> threads as

> +time consistency is not guaranteed, and in some cases that's enough.

> +So, local time stamps are local to the calling thread and must not be

> shared

> +with other threads. Current local time can be read with

> +odp_time_local()+.

> +

> +==== Global time

> +The global time API is designed to be used for tracking time between

> threads.

> +So, global time stamps can be shared between threads. Current global time

> can

> +be read with +odp_time_global()+.

> +

> +Both, local and global time is not wrapped during the application life

> cycle.

> +The time API includes functions to operate with time, such as

> +odp_time_diff()+,

> ++odp_time_sum()+, +odp_time_cmp()+, conversion functions like

> ++odp_time_to_ns()+, +odp_time_local_from_ns()+,

> +odp_time_global_from_ns()+.

> +To get rate of time source +odp_time_local_res()+, +odp_time_global_res()+

> +are used. To wait, +odp_time_wait_ns()+ and +odp_time_wait_until()+ are

> used,

> +during witch a thread potentially busy loop the entire wait time.

> +

> +The +odp_time_t+ opaque type represents local or global timestamps.

> +

>  === Timer

>  Timers are how ODP applications measure and respond to the passage of

> time.

>  Timers are drawn from specialized pools called timer pools that have their

> --

> 1.9.1

>

>
Bill Fischofer Dec. 23, 2015, 1:28 p.m. UTC | #2
On Wed, Dec 23, 2015 at 7:24 AM, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

>

>

> On Wed, Dec 23, 2015 at 6:32 AM, Ivan Khoronzhuk <

> ivan.khoronzhuk@linaro.org> wrote:

>

>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

>>

>

> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

>

>

>> ---

>>  doc/users-guide/users-guide.adoc | 29 ++++++++++++++++++++++++++++-

>>  1 file changed, 28 insertions(+), 1 deletion(-)

>>

>> diff --git a/doc/users-guide/users-guide.adoc

>> b/doc/users-guide/users-guide.adoc

>> index 7ec7957..e8465d0 100644

>> --- a/doc/users-guide/users-guide.adoc

>> +++ b/doc/users-guide/users-guide.adoc

>> @@ -197,7 +197,7 @@ precise syntax and semantics of each API.

>>  ODP programs are built around several conceptual structures that every

>>  application programmer needs to be familiar with to use ODP effectively.

>> The

>>  main ODP concepts are:

>> -Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Timer,

>> +Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Time,

>> Timer,

>>  and Synchronizer.

>>

>>  === Thread

>> @@ -305,6 +305,33 @@ or may represent a device attached via a PCIE or

>> other bus.

>>

>>  PktIOs are represented by handles of abstract type +odp_pktio_t+.

>>

>> +=== Time

>> +The time API is used to measure time intervals and track time flow of an

>> +application and presents a convenient way to get access to a time source.

>> +The time API consists of two main parts: local time API and global time

>> API.

>> +

>> +==== Local time

>> +The local time API is designed to be used within one thread and can be

>> faster

>> +then the global time API. The local time API cannot be used between

>> threads as

>>

>

Slight grammar nit.  Change then to than.  Maxim, if this can be done on
the merge please do so, otherwise I'll add this on my next clean-up pass.

As an aside, than and then can be a bit confusing.  See
http://grammarist.com/usage/than-then/ for a good explanation of how they
are used.


> +time consistency is not guaranteed, and in some cases that's enough.

>> +So, local time stamps are local to the calling thread and must not be

>> shared

>> +with other threads. Current local time can be read with

>> +odp_time_local()+.

>> +

>> +==== Global time

>> +The global time API is designed to be used for tracking time between

>> threads.

>> +So, global time stamps can be shared between threads. Current global

>> time can

>> +be read with +odp_time_global()+.

>> +

>> +Both, local and global time is not wrapped during the application life

>> cycle.

>> +The time API includes functions to operate with time, such as

>> +odp_time_diff()+,

>> ++odp_time_sum()+, +odp_time_cmp()+, conversion functions like

>> ++odp_time_to_ns()+, +odp_time_local_from_ns()+,

>> +odp_time_global_from_ns()+.

>> +To get rate of time source +odp_time_local_res()+,

>> +odp_time_global_res()+

>> +are used. To wait, +odp_time_wait_ns()+ and +odp_time_wait_until()+ are

>> used,

>> +during witch a thread potentially busy loop the entire wait time.

>> +

>> +The +odp_time_t+ opaque type represents local or global timestamps.

>> +

>>  === Timer

>>  Timers are how ODP applications measure and respond to the passage of

>> time.

>>  Timers are drawn from specialized pools called timer pools that have

>> their

>> --

>> 1.9.1

>>

>>

>
Ivan Khoronzhuk Dec. 23, 2015, 1:33 p.m. UTC | #3
On 23.12.15 15:28, Bill Fischofer wrote:
>
>
> On Wed, Dec 23, 2015 at 7:24 AM, Bill Fischofer <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>
>
>
>     On Wed, Dec 23, 2015 at 6:32 AM, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org <mailto:ivan.khoronzhuk@linaro.org>> wrote:
>
>         Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org <mailto:ivan.khoronzhuk@linaro.org>>
>
>
>     Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>
>
>         ---
>           doc/users-guide/users-guide.adoc | 29 ++++++++++++++++++++++++++++-
>           1 file changed, 28 insertions(+), 1 deletion(-)
>
>         diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc
>         index 7ec7957..e8465d0 100644
>         --- a/doc/users-guide/users-guide.adoc
>         +++ b/doc/users-guide/users-guide.adoc
>         @@ -197,7 +197,7 @@ precise syntax and semantics of each API.
>           ODP programs are built around several conceptual structures that every
>           application programmer needs to be familiar with to use ODP effectively. The
>           main ODP concepts are:
>         -Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Timer,
>         +Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Time, Timer,
>           and Synchronizer.
>
>           === Thread
>         @@ -305,6 +305,33 @@ or may represent a device attached via a PCIE or other bus.
>
>           PktIOs are represented by handles of abstract type +odp_pktio_t+.
>
>         +=== Time
>         +The time API is used to measure time intervals and track time flow of an
>         +application and presents a convenient way to get access to a time source.
>         +The time API consists of two main parts: local time API and global time API.
>         +
>         +==== Local time
>         +The local time API is designed to be used within one thread and can be faster
>         +then the global time API. The local time API cannot be used between threads as
>
>
> Slight grammar nit.  Change then to than.  Maxim, if this can be done on the merge please do so, otherwise I'll add this on my next clean-up pass.
It's typo, I know the meaning, thanks.
Will send v4 with your reviewed-by.

>
> As an aside, than and then can be a bit confusing.  See http://grammarist.com/usage/than-then/ for a good explanation of how they are used.
>
>         +time consistency is not guaranteed, and in some cases that's enough.
>         +So, local time stamps are local to the calling thread and must not be shared
>         +with other threads. Current local time can be read with +odp_time_local()+.
>         +
>         +==== Global time
>         +The global time API is designed to be used for tracking time between threads.
>         +So, global time stamps can be shared between threads. Current global time can
>         +be read with +odp_time_global()+.
>         +
>         +Both, local and global time is not wrapped during the application life cycle.
>         +The time API includes functions to operate with time, such as +odp_time_diff()+,
>         ++odp_time_sum()+, +odp_time_cmp()+, conversion functions like
>         ++odp_time_to_ns()+, +odp_time_local_from_ns()+, +odp_time_global_from_ns()+.
>         +To get rate of time source +odp_time_local_res()+, +odp_time_global_res()+
>         +are used. To wait, +odp_time_wait_ns()+ and +odp_time_wait_until()+ are used,
>         +during witch a thread potentially busy loop the entire wait time.
>         +
>         +The +odp_time_t+ opaque type represents local or global timestamps.
>         +
>           === Timer
>           Timers are how ODP applications measure and respond to the passage of time.
>           Timers are drawn from specialized pools called timer pools that have their
>         --
>         1.9.1
>
>
>
Maxim Uvarov Dec. 25, 2015, 8:19 a.m. UTC | #4
That was also merged.

Maxim.

On 12/23/2015 16:33, Ivan Khoronzhuk wrote:
>
>
> On 23.12.15 15:28, Bill Fischofer wrote:
>>
>>
>> On Wed, Dec 23, 2015 at 7:24 AM, Bill Fischofer 
>> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>>
>>
>>
>>     On Wed, Dec 23, 2015 at 6:32 AM, Ivan Khoronzhuk 
>> <ivan.khoronzhuk@linaro.org <mailto:ivan.khoronzhuk@linaro.org>> wrote:
>>
>>         Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org 
>> <mailto:ivan.khoronzhuk@linaro.org>>
>>
>>
>>     Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
>> <mailto:bill.fischofer@linaro.org>>
>>
>>         ---
>>           doc/users-guide/users-guide.adoc | 29 
>> ++++++++++++++++++++++++++++-
>>           1 file changed, 28 insertions(+), 1 deletion(-)
>>
>>         diff --git a/doc/users-guide/users-guide.adoc 
>> b/doc/users-guide/users-guide.adoc
>>         index 7ec7957..e8465d0 100644
>>         --- a/doc/users-guide/users-guide.adoc
>>         +++ b/doc/users-guide/users-guide.adoc
>>         @@ -197,7 +197,7 @@ precise syntax and semantics of each API.
>>           ODP programs are built around several conceptual structures 
>> that every
>>           application programmer needs to be familiar with to use ODP 
>> effectively. The
>>           main ODP concepts are:
>>         -Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, 
>> PktIO, Timer,
>>         +Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, 
>> PktIO, Time, Timer,
>>           and Synchronizer.
>>
>>           === Thread
>>         @@ -305,6 +305,33 @@ or may represent a device attached via a 
>> PCIE or other bus.
>>
>>           PktIOs are represented by handles of abstract type 
>> +odp_pktio_t+.
>>
>>         +=== Time
>>         +The time API is used to measure time intervals and track 
>> time flow of an
>>         +application and presents a convenient way to get access to a 
>> time source.
>>         +The time API consists of two main parts: local time API and 
>> global time API.
>>         +
>>         +==== Local time
>>         +The local time API is designed to be used within one thread 
>> and can be faster
>>         +then the global time API. The local time API cannot be used 
>> between threads as
>>
>>
>> Slight grammar nit.  Change then to than.  Maxim, if this can be done 
>> on the merge please do so, otherwise I'll add this on my next 
>> clean-up pass.
> It's typo, I know the meaning, thanks.
> Will send v4 with your reviewed-by.
>
>>
>> As an aside, than and then can be a bit confusing.  See 
>> http://grammarist.com/usage/than-then/ for a good explanation of how 
>> they are used.
>>
>>         +time consistency is not guaranteed, and in some cases that's 
>> enough.
>>         +So, local time stamps are local to the calling thread and 
>> must not be shared
>>         +with other threads. Current local time can be read with 
>> +odp_time_local()+.
>>         +
>>         +==== Global time
>>         +The global time API is designed to be used for tracking time 
>> between threads.
>>         +So, global time stamps can be shared between threads. 
>> Current global time can
>>         +be read with +odp_time_global()+.
>>         +
>>         +Both, local and global time is not wrapped during the 
>> application life cycle.
>>         +The time API includes functions to operate with time, such 
>> as +odp_time_diff()+,
>>         ++odp_time_sum()+, +odp_time_cmp()+, conversion functions like
>>         ++odp_time_to_ns()+, +odp_time_local_from_ns()+, 
>> +odp_time_global_from_ns()+.
>>         +To get rate of time source +odp_time_local_res()+, 
>> +odp_time_global_res()+
>>         +are used. To wait, +odp_time_wait_ns()+ and 
>> +odp_time_wait_until()+ are used,
>>         +during witch a thread potentially busy loop the entire wait 
>> time.
>>         +
>>         +The +odp_time_t+ opaque type represents local or global 
>> timestamps.
>>         +
>>           === Timer
>>           Timers are how ODP applications measure and respond to the 
>> passage of time.
>>           Timers are drawn from specialized pools called timer pools 
>> that have their
>>         --
>>         1.9.1
>>
>>
>>
>
diff mbox

Patch

diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc
index 7ec7957..e8465d0 100644
--- a/doc/users-guide/users-guide.adoc
+++ b/doc/users-guide/users-guide.adoc
@@ -197,7 +197,7 @@  precise syntax and semantics of each API.
 ODP programs are built around several conceptual structures that every
 application programmer needs to be familiar with to use ODP effectively. The
 main ODP concepts are:
-Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Timer,
+Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Time, Timer,
 and Synchronizer.
 
 === Thread
@@ -305,6 +305,33 @@  or may represent a device attached via a PCIE or other bus.
 
 PktIOs are represented by handles of abstract type +odp_pktio_t+.
 
+=== Time
+The time API is used to measure time intervals and track time flow of an
+application and presents a convenient way to get access to a time source.
+The time API consists of two main parts: local time API and global time API.
+
+==== Local time
+The local time API is designed to be used within one thread and can be faster
+then the global time API. The local time API cannot be used between threads as
+time consistency is not guaranteed, and in some cases that's enough.
+So, local time stamps are local to the calling thread and must not be shared
+with other threads. Current local time can be read with +odp_time_local()+.
+
+==== Global time
+The global time API is designed to be used for tracking time between threads.
+So, global time stamps can be shared between threads. Current global time can
+be read with +odp_time_global()+.
+
+Both, local and global time is not wrapped during the application life cycle.
+The time API includes functions to operate with time, such as +odp_time_diff()+,
++odp_time_sum()+, +odp_time_cmp()+, conversion functions like
++odp_time_to_ns()+, +odp_time_local_from_ns()+, +odp_time_global_from_ns()+.
+To get rate of time source +odp_time_local_res()+, +odp_time_global_res()+
+are used. To wait, +odp_time_wait_ns()+ and +odp_time_wait_until()+ are used,
+during witch a thread potentially busy loop the entire wait time.
+
+The +odp_time_t+ opaque type represents local or global timestamps.
+
 === Timer
 Timers are how ODP applications measure and respond to the passage of time.
 Timers are drawn from specialized pools called timer pools that have their