Message ID | 1421316393-31827-1-git-send-email-ola.liljedahl@linaro.org |
---|---|
State | New |
Headers | show |
On 15 January 2015 at 12:22, Savolainen, Petri (NSN - FI/Espoo) <petri.savolainen@nsn.com> wrote: > > >> -----Original Message----- >> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- >> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl >> Sent: Thursday, January 15, 2015 12:07 PM >> To: lng-odp@lists.linaro.org >> Subject: [lng-odp] [PATCH] example: odp_timer_test.c: bug 1068 - >> odp_timer_test aborts >> >> Since the scheduler does not guarantee fairness in scheduling, threads >> must >> time out and check if the example is still running. If this is the case, >> just restart the scheduler loop (not the whole example loop which may have >> other side effects, e.g. resetting timers with some random tick value), >> otherwise break out of the example loop which will terminate the example. >> >> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> >> --- >> (This document/code contribution attached is provided under the terms of >> agreement LES-LTM-21309) >> >> example/timer/odp_timer_test.c | 21 +++++++++++++++------ >> 1 file changed, 15 insertions(+), 6 deletions(-) >> >> diff --git a/example/timer/odp_timer_test.c >> b/example/timer/odp_timer_test.c >> index 5de499b..dfd6c70 100644 >> --- a/example/timer/odp_timer_test.c >> +++ b/example/timer/odp_timer_test.c >> @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, test_args_t >> *args) >> } >> >> /* Get the next expired timeout */ >> - /* Use 1.5 second timeout for scheduler */ >> - uint64_t sched_tmo = odp_schedule_wait_time(1500000000ULL); >> - buf = odp_schedule(&queue, sched_tmo); >> - /* Check if odp_schedule() timed out, possibly there are no >> - * remaining timeouts to receive */ >> + /* We invoke the scheduler in a loop with a timeout because >> + * we are not guaranteed to receive any more timeouts. The >> + * scheduler isn't guaranteeing fairness when scheduling >> + * buffers to threads */ >> + do { >> + /* Use 1.5 second timeout for scheduler */ >> + uint64_t sched_tmo = >> + odp_schedule_wait_time(1500000000ULL); > > No need to repeat wait time conversion in the loop. It's better to keep it out side of the loop since this is an example and should demonstrate the correct/elegant way of using the APIs. Calling odp_schedule() with a long timeout in a loop is IMO not a very elegant way of using the scheduler API. It is a brutal work-around. -- Ola > > -Petri > >> + buf = odp_schedule(&queue, sched_tmo); >> + /* Check if odp_schedule() timed out, possibly there >> + * are no remaining timeouts to receive */ >> + } while (buf == ODP_BUFFER_INVALID && >> + (int)odp_atomic_load_u32(&remain) > 0); >> + >> if (buf == ODP_BUFFER_INVALID) >> - continue; /* Re-check the remain counter */ >> + break; /* No more timeouts */ >> if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { >> /* Not a default timeout buffer */ >> EXAMPLE_ABORT("Unexpected buffer type (%u) received\n", >> -- >> 1.9.1 >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp
On 15 January 2015 at 06:36, Ola Liljedahl <ola.liljedahl@linaro.org> wrote: > On 15 January 2015 at 12:22, Savolainen, Petri (NSN - FI/Espoo) > <petri.savolainen@nsn.com> wrote: > > > > > >> -----Original Message----- > >> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- > >> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl > >> Sent: Thursday, January 15, 2015 12:07 PM > >> To: lng-odp@lists.linaro.org > >> Subject: [lng-odp] [PATCH] example: odp_timer_test.c: bug 1068 - > >> odp_timer_test aborts > >> > >> Since the scheduler does not guarantee fairness in scheduling, threads > >> must > >> time out and check if the example is still running. If this is the case, > >> just restart the scheduler loop (not the whole example loop which may > have > >> other side effects, e.g. resetting timers with some random tick value), > >> otherwise break out of the example loop which will terminate the > example. > >> > >> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> > Missing Reported-by > >> --- > >> (This document/code contribution attached is provided under the terms of > >> agreement LES-LTM-21309) > >> > >> example/timer/odp_timer_test.c | 21 +++++++++++++++------ > >> 1 file changed, 15 insertions(+), 6 deletions(-) > >> > >> diff --git a/example/timer/odp_timer_test.c > >> b/example/timer/odp_timer_test.c > >> index 5de499b..dfd6c70 100644 > >> --- a/example/timer/odp_timer_test.c > >> +++ b/example/timer/odp_timer_test.c > >> @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, test_args_t > >> *args) > >> } > >> > >> /* Get the next expired timeout */ > >> - /* Use 1.5 second timeout for scheduler */ > >> - uint64_t sched_tmo = > odp_schedule_wait_time(1500000000ULL); > >> - buf = odp_schedule(&queue, sched_tmo); > >> - /* Check if odp_schedule() timed out, possibly there are > no > >> - * remaining timeouts to receive */ > >> + /* We invoke the scheduler in a loop with a timeout > because > >> + * we are not guaranteed to receive any more timeouts. The > >> + * scheduler isn't guaranteeing fairness when scheduling > >> + * buffers to threads */ > >> + do { > >> + /* Use 1.5 second timeout for scheduler */ > >> + uint64_t sched_tmo = > >> + odp_schedule_wait_time(1500000000ULL); > > > > No need to repeat wait time conversion in the loop. It's better to keep > it out side of the loop since this is an example and should demonstrate the > correct/elegant way of using the APIs. > Calling odp_schedule() with a long timeout in a loop is IMO not a very > elegant way of using the scheduler API. It is a brutal work-around. > > -- Ola > > > > > -Petri > > > >> + buf = odp_schedule(&queue, sched_tmo); > >> + /* Check if odp_schedule() timed out, possibly > there > >> + * are no remaining timeouts to receive */ > >> + } while (buf == ODP_BUFFER_INVALID && > >> + (int)odp_atomic_load_u32(&remain) > 0); > >> + > >> if (buf == ODP_BUFFER_INVALID) > >> - continue; /* Re-check the remain counter */ > >> + break; /* No more timeouts */ > >> if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { > >> /* Not a default timeout buffer */ > >> EXAMPLE_ABORT("Unexpected buffer type (%u) > received\n", > >> -- > >> 1.9.1 > >> > >> > >> _______________________________________________ > >> lng-odp mailing list > >> lng-odp@lists.linaro.org > >> http://lists.linaro.org/mailman/listinfo/lng-odp > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 01/16/2015 03:10 AM, Anders Roxell wrote: > On 2015-01-15 08:49, Mike Holmes wrote: >> On 15 January 2015 at 06:36, Ola Liljedahl <ola.liljedahl@linaro.org> wrote: >> >>> On 15 January 2015 at 12:22, Savolainen, Petri (NSN - FI/Espoo) >>> <petri.savolainen@nsn.com> wrote: >>>> >>>>> -----Original Message----- >>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- >>>>> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl >>>>> Sent: Thursday, January 15, 2015 12:07 PM >>>>> To: lng-odp@lists.linaro.org >>>>> Subject: [lng-odp] [PATCH] example: odp_timer_test.c: bug 1068 - >>>>> odp_timer_test aborts >>>>> >>>>> Since the scheduler does not guarantee fairness in scheduling, threads >>>>> must >>>>> time out and check if the example is still running. If this is the case, >>>>> just restart the scheduler loop (not the whole example loop which may >>> have >>>>> other side effects, e.g. resetting timers with some random tick value), >>>>> otherwise break out of the example loop which will terminate the >>> example. >>>>> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> >> Missing Reported-by > and I'm not sure that the short log should contain the bug > number... if we want bug number I think that should go into the > description. > > Cheers, > Anders Yes, short log should not have bug number. Please send v2. Maxim. > >> >>>>> --- >>>>> (This document/code contribution attached is provided under the terms of >>>>> agreement LES-LTM-21309) >>>>> >>>>> example/timer/odp_timer_test.c | 21 +++++++++++++++------ >>>>> 1 file changed, 15 insertions(+), 6 deletions(-) >>>>> >>>>> diff --git a/example/timer/odp_timer_test.c >>>>> b/example/timer/odp_timer_test.c >>>>> index 5de499b..dfd6c70 100644 >>>>> --- a/example/timer/odp_timer_test.c >>>>> +++ b/example/timer/odp_timer_test.c >>>>> @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, test_args_t >>>>> *args) >>>>> } >>>>> >>>>> /* Get the next expired timeout */ >>>>> - /* Use 1.5 second timeout for scheduler */ >>>>> - uint64_t sched_tmo = >>> odp_schedule_wait_time(1500000000ULL); >>>>> - buf = odp_schedule(&queue, sched_tmo); >>>>> - /* Check if odp_schedule() timed out, possibly there are >>> no >>>>> - * remaining timeouts to receive */ >>>>> + /* We invoke the scheduler in a loop with a timeout >>> because >>>>> + * we are not guaranteed to receive any more timeouts. The >>>>> + * scheduler isn't guaranteeing fairness when scheduling >>>>> + * buffers to threads */ >>>>> + do { >>>>> + /* Use 1.5 second timeout for scheduler */ >>>>> + uint64_t sched_tmo = >>>>> + odp_schedule_wait_time(1500000000ULL); >>>> No need to repeat wait time conversion in the loop. It's better to keep >>> it out side of the loop since this is an example and should demonstrate the >>> correct/elegant way of using the APIs. >>> Calling odp_schedule() with a long timeout in a loop is IMO not a very >>> elegant way of using the scheduler API. It is a brutal work-around. >>> >>> -- Ola >>> >>>> -Petri >>>> >>>>> + buf = odp_schedule(&queue, sched_tmo); >>>>> + /* Check if odp_schedule() timed out, possibly >>> there >>>>> + * are no remaining timeouts to receive */ >>>>> + } while (buf == ODP_BUFFER_INVALID && >>>>> + (int)odp_atomic_load_u32(&remain) > 0); >>>>> + >>>>> if (buf == ODP_BUFFER_INVALID) >>>>> - continue; /* Re-check the remain counter */ >>>>> + break; /* No more timeouts */ >>>>> if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { >>>>> /* Not a default timeout buffer */ >>>>> EXAMPLE_ABORT("Unexpected buffer type (%u) >>> received\n", >>>>> -- >>>>> 1.9.1 >>>>> >>>>> >>>>> _______________________________________________ >>>>> lng-odp mailing list >>>>> lng-odp@lists.linaro.org >>>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> >> >> -- >> *Mike Holmes* >> Linaro Sr Technical Manager >> LNG - ODP >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >
I agree. I see the sort of structure below as as our style, tIf a guide is needed see the CONTRIBUTING file and possibly even better looking in odp git to see how it has been done before, use "git show" *Bugzilla Issue format* <odp area>: <file>: <short description> Longer description of the issue << multiple lines Why the patch is needed What the patch does *https://bugs.linaro.org/show_bug.cgi?id= <https://bugs.linaro.org/show_bug.cgi?id=><BUG NUMBER>* Signed-off-by: --- ---------------------------------------------------------------------------------------- *Coverity Issue Directly* <odp area>: <file>: <short description> Longer description of the issue << multiple lines Why the patch is needed What the patch does *CID 85531: * Signed-off-by: --- ---------------------------------------------------------------------------------------- *New work* <odp area>: <file>: <short description> Longer description of the issue << multiple lines Why the patch is needed What the patch does Signed-off-by: ---- Any information for the reviewers that is not important to capture in the git history ---------------------------------------------------------------------------------------- *Explanation* The <> examples:- <odp area> api, helper, validation, performance, example, linux-generic: api, linux-generic <file> filename if possible drop the suffix, may not be sensible for all patches <short description> total subject line 50 to 70 chars On 15 January 2015 at 11:46, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > On 01/16/2015 03:10 AM, Anders Roxell wrote: > >> On 2015-01-15 08:49, Mike Holmes wrote: >> >>> On 15 January 2015 at 06:36, Ola Liljedahl <ola.liljedahl@linaro.org> >>> wrote: >>> >>> On 15 January 2015 at 12:22, Savolainen, Petri (NSN - FI/Espoo) >>>> <petri.savolainen@nsn.com> wrote: >>>> >>>>> >>>>> -----Original Message----- >>>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- >>>>>> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl >>>>>> Sent: Thursday, January 15, 2015 12:07 PM >>>>>> To: lng-odp@lists.linaro.org >>>>>> Subject: [lng-odp] [PATCH] example: odp_timer_test.c: bug 1068 - >>>>>> odp_timer_test aborts >>>>>> >>>>>> Since the scheduler does not guarantee fairness in scheduling, threads >>>>>> must >>>>>> time out and check if the example is still running. If this is the >>>>>> case, >>>>>> just restart the scheduler loop (not the whole example loop which may >>>>>> >>>>> have >>>> >>>>> other side effects, e.g. resetting timers with some random tick value), >>>>>> otherwise break out of the example loop which will terminate the >>>>>> >>>>> example. >>>> >>>>> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> >>>>>> >>>>> Missing Reported-by >>> >> and I'm not sure that the short log should contain the bug >> number... if we want bug number I think that should go into the >> description. >> >> Cheers, >> Anders >> > > Yes, short log should not have bug number. Please send v2. > > Maxim. > > > >> >>> --- >>>>>> (This document/code contribution attached is provided under the terms >>>>>> of >>>>>> agreement LES-LTM-21309) >>>>>> >>>>>> example/timer/odp_timer_test.c | 21 +++++++++++++++------ >>>>>> 1 file changed, 15 insertions(+), 6 deletions(-) >>>>>> >>>>>> diff --git a/example/timer/odp_timer_test.c >>>>>> b/example/timer/odp_timer_test.c >>>>>> index 5de499b..dfd6c70 100644 >>>>>> --- a/example/timer/odp_timer_test.c >>>>>> +++ b/example/timer/odp_timer_test.c >>>>>> @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, >>>>>> test_args_t >>>>>> *args) >>>>>> } >>>>>> >>>>>> /* Get the next expired timeout */ >>>>>> - /* Use 1.5 second timeout for scheduler */ >>>>>> - uint64_t sched_tmo = >>>>>> >>>>> odp_schedule_wait_time(1500000000ULL); >>>> >>>>> - buf = odp_schedule(&queue, sched_tmo); >>>>>> - /* Check if odp_schedule() timed out, possibly there are >>>>>> >>>>> no >>>> >>>>> - * remaining timeouts to receive */ >>>>>> + /* We invoke the scheduler in a loop with a timeout >>>>>> >>>>> because >>>> >>>>> + * we are not guaranteed to receive any more timeouts. >>>>>> The >>>>>> + * scheduler isn't guaranteeing fairness when scheduling >>>>>> + * buffers to threads */ >>>>>> + do { >>>>>> + /* Use 1.5 second timeout for scheduler */ >>>>>> + uint64_t sched_tmo = >>>>>> + odp_schedule_wait_time(1500000000ULL); >>>>>> >>>>> No need to repeat wait time conversion in the loop. It's better to keep >>>>> >>>> it out side of the loop since this is an example and should demonstrate >>>> the >>>> correct/elegant way of using the APIs. >>>> Calling odp_schedule() with a long timeout in a loop is IMO not a very >>>> elegant way of using the scheduler API. It is a brutal work-around. >>>> >>>> -- Ola >>>> >>>> -Petri >>>>> >>>>> + buf = odp_schedule(&queue, sched_tmo); >>>>>> + /* Check if odp_schedule() timed out, possibly >>>>>> >>>>> there >>>> >>>>> + * are no remaining timeouts to receive */ >>>>>> + } while (buf == ODP_BUFFER_INVALID && >>>>>> + (int)odp_atomic_load_u32(&remain) > 0); >>>>>> + >>>>>> if (buf == ODP_BUFFER_INVALID) >>>>>> - continue; /* Re-check the remain counter */ >>>>>> + break; /* No more timeouts */ >>>>>> if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { >>>>>> /* Not a default timeout buffer */ >>>>>> EXAMPLE_ABORT("Unexpected buffer type (%u) >>>>>> >>>>> received\n", >>>> >>>>> -- >>>>>> 1.9.1 >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> lng-odp mailing list >>>>>> lng-odp@lists.linaro.org >>>>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>>>>> >>>>> _______________________________________________ >>>> lng-odp mailing list >>>> lng-odp@lists.linaro.org >>>> http://lists.linaro.org/mailman/listinfo/lng-odp >>>> >>>> >>> >>> -- >>> *Mike Holmes* >>> Linaro Sr Technical Manager >>> LNG - ODP >>> _______________________________________________ >>> lng-odp mailing list >>> lng-odp@lists.linaro.org >>> http://lists.linaro.org/mailman/listinfo/lng-odp >>> >> >> > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 2015-01-15 08:49, Mike Holmes wrote: > On 15 January 2015 at 06:36, Ola Liljedahl <ola.liljedahl@linaro.org> wrote: > > > On 15 January 2015 at 12:22, Savolainen, Petri (NSN - FI/Espoo) > > <petri.savolainen@nsn.com> wrote: > > > > > > > > >> -----Original Message----- > > >> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp- > > >> bounces@lists.linaro.org] On Behalf Of ext Ola Liljedahl > > >> Sent: Thursday, January 15, 2015 12:07 PM > > >> To: lng-odp@lists.linaro.org > > >> Subject: [lng-odp] [PATCH] example: odp_timer_test.c: bug 1068 - > > >> odp_timer_test aborts > > >> > > >> Since the scheduler does not guarantee fairness in scheduling, threads > > >> must > > >> time out and check if the example is still running. If this is the case, > > >> just restart the scheduler loop (not the whole example loop which may > > have > > >> other side effects, e.g. resetting timers with some random tick value), > > >> otherwise break out of the example loop which will terminate the > > example. > > >> > > >> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> > > > > Missing Reported-by and I'm not sure that the short log should contain the bug number... if we want bug number I think that should go into the description. Cheers, Anders > > > > >> --- > > >> (This document/code contribution attached is provided under the terms of > > >> agreement LES-LTM-21309) > > >> > > >> example/timer/odp_timer_test.c | 21 +++++++++++++++------ > > >> 1 file changed, 15 insertions(+), 6 deletions(-) > > >> > > >> diff --git a/example/timer/odp_timer_test.c > > >> b/example/timer/odp_timer_test.c > > >> index 5de499b..dfd6c70 100644 > > >> --- a/example/timer/odp_timer_test.c > > >> +++ b/example/timer/odp_timer_test.c > > >> @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, test_args_t > > >> *args) > > >> } > > >> > > >> /* Get the next expired timeout */ > > >> - /* Use 1.5 second timeout for scheduler */ > > >> - uint64_t sched_tmo = > > odp_schedule_wait_time(1500000000ULL); > > >> - buf = odp_schedule(&queue, sched_tmo); > > >> - /* Check if odp_schedule() timed out, possibly there are > > no > > >> - * remaining timeouts to receive */ > > >> + /* We invoke the scheduler in a loop with a timeout > > because > > >> + * we are not guaranteed to receive any more timeouts. The > > >> + * scheduler isn't guaranteeing fairness when scheduling > > >> + * buffers to threads */ > > >> + do { > > >> + /* Use 1.5 second timeout for scheduler */ > > >> + uint64_t sched_tmo = > > >> + odp_schedule_wait_time(1500000000ULL); > > > > > > No need to repeat wait time conversion in the loop. It's better to keep > > it out side of the loop since this is an example and should demonstrate the > > correct/elegant way of using the APIs. > > Calling odp_schedule() with a long timeout in a loop is IMO not a very > > elegant way of using the scheduler API. It is a brutal work-around. > > > > -- Ola > > > > > > > > -Petri > > > > > >> + buf = odp_schedule(&queue, sched_tmo); > > >> + /* Check if odp_schedule() timed out, possibly > > there > > >> + * are no remaining timeouts to receive */ > > >> + } while (buf == ODP_BUFFER_INVALID && > > >> + (int)odp_atomic_load_u32(&remain) > 0); > > >> + > > >> if (buf == ODP_BUFFER_INVALID) > > >> - continue; /* Re-check the remain counter */ > > >> + break; /* No more timeouts */ > > >> if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { > > >> /* Not a default timeout buffer */ > > >> EXAMPLE_ABORT("Unexpected buffer type (%u) > > received\n", > > >> -- > > >> 1.9.1 > > >> > > >> > > >> _______________________________________________ > > >> lng-odp mailing list > > >> lng-odp@lists.linaro.org > > >> http://lists.linaro.org/mailman/listinfo/lng-odp > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > -- > *Mike Holmes* > Linaro Sr Technical Manager > LNG - ODP > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5de499b..dfd6c70 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -126,13 +126,22 @@ static void test_abs_timeouts(int thr, test_args_t *args) } /* Get the next expired timeout */ - /* Use 1.5 second timeout for scheduler */ - uint64_t sched_tmo = odp_schedule_wait_time(1500000000ULL); - buf = odp_schedule(&queue, sched_tmo); - /* Check if odp_schedule() timed out, possibly there are no - * remaining timeouts to receive */ + /* We invoke the scheduler in a loop with a timeout because + * we are not guaranteed to receive any more timeouts. The + * scheduler isn't guaranteeing fairness when scheduling + * buffers to threads */ + do { + /* Use 1.5 second timeout for scheduler */ + uint64_t sched_tmo = + odp_schedule_wait_time(1500000000ULL); + buf = odp_schedule(&queue, sched_tmo); + /* Check if odp_schedule() timed out, possibly there + * are no remaining timeouts to receive */ + } while (buf == ODP_BUFFER_INVALID && + (int)odp_atomic_load_u32(&remain) > 0); + if (buf == ODP_BUFFER_INVALID) - continue; /* Re-check the remain counter */ + break; /* No more timeouts */ if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { /* Not a default timeout buffer */ EXAMPLE_ABORT("Unexpected buffer type (%u) received\n",
Since the scheduler does not guarantee fairness in scheduling, threads must time out and check if the example is still running. If this is the case, just restart the scheduler loop (not the whole example loop which may have other side effects, e.g. resetting timers with some random tick value), otherwise break out of the example loop which will terminate the example. Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) example/timer/odp_timer_test.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)