diff mbox

[lng-od,API-NEXT,v2] doc/users-guide: add time API section

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

Commit Message

Ivan Khoronzhuk Dec. 21, 2015, 12:53 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, 3:38 a.m. UTC | #1
On Mon, Dec 21, 2015 at 6:53 AM, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org
> wrote:


> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@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..b11d050 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 time source.

>


to a time source would seem clearer.


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

> API.

> +

> +Local time

>


This doesn't format correctly.  If you wanted this as a subheader it should
be
==== Local Time


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

> faster



"is designed to be" would be clearer


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

> as time

>


than the global time API


> +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

>


==== Global Time


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

> threads.

>


Again, "is designed to be" would be clearer


> +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 application life cycle.

>


during the application life cycle


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

> +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.

>


[Add a blank line for a paragraph break here for better readability.]


> +The +odp_time_t+ opaque type represents or local or global timestamp, the

> +responsibility is on a user to use time operations with appropriate time

> type.

>


It's not clear what you're saying here with "the responsibility...".  I'd
just leave this as

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

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Ivan Khoronzhuk Dec. 23, 2015, 11:46 a.m. UTC | #2
On 23.12.15 05:38, Bill Fischofer wrote:
>
>
> On Mon, Dec 21, 2015 at 6:53 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>>
>     ---
>       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..b11d050 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 time source.
>
>
> to a time source would seem clearer.
Ok. Will send v3 soon.

>
>     +The time API consists of two main parts: local time API and global time API.
>     +
>     +Local time
>
>
> This doesn't format correctly.  If you wanted this as a subheader it should be
> ==== Local Time
>
>     +The local time API is supposed to be used within one thread and can be faster
>
>
> "is designed to be" would be clearer
>
>     +then global time API. The local time API cannot be used between threads as time
>
>
> than the global time API
>
>     +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
>
>
> ==== Global Time
>
>     +The global time API is supposed to be used for tracking time between threads.
>
>
> Again, "is designed to be" would be clearer
>
>     +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 application life cycle.
>
>
> during the application life cycle
>
>     +The time API includes functions to operate with time, such +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.
>
>
> [Add a blank line for a paragraph break here for better readability.]
>
>     +The +odp_time_t+ opaque type represents or local or global timestamp, the
>     +responsibility is on a user to use time operations with appropriate time type.
>
>
> It's not clear what you're saying here with "the responsibility...".  I'd just leave this as
>
> 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
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc
index 7ec7957..b11d050 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 time source.
+The time API consists of two main parts: local time API and global time API.
+
+Local time
+The local time API is supposed to be used within one thread and can be faster
+then 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 supposed 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 application life cycle.
+The time API includes functions to operate with time, such +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 or local or global timestamp, the
+responsibility is on a user to use time operations with appropriate time type.
+
 === 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