[API-NEXT,v1,1/1] api: schedule: add thread removal correction

Message ID 1497556807-26704-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • api: schedule: add thread removal correction
Related show

Commit Message

Github ODP bot June 15, 2017, 8 p.m.
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>


Clarify thread removal status from scheduler group
before calling odp_schedule_group_destroy.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Reviewed-by: Brian Brooks <brian.brooks@arm.com>

Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>

---
/** Email created from pull request 53 (nagarahalli:api-next-sched-grp)
 ** https://github.com/Linaro/odp/pull/53
 ** Patch: https://github.com/Linaro/odp/pull/53.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: b3fd065fae878adcf0bcfdd2da6f202214de6d92
 **/
 include/odp/api/spec/schedule.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Savolainen, Petri (Nokia - FI/Espoo) June 16, 2017, 10:16 a.m. | #1
> -----Original Message-----

> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of

> Github ODP bot

> Sent: Thursday, June 15, 2017 11:00 PM

> To: lng-odp@lists.linaro.org

> Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: schedule: add thread

> removal correction

> 

> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> 

> Clarify thread removal status from scheduler group

> before calling odp_schedule_group_destroy.

> 

> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> Reviewed-by: Brian Brooks <brian.brooks@arm.com>

> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>

> ---

> /** Email created from pull request 53 (nagarahalli:api-next-sched-grp)

>  ** https://github.com/Linaro/odp/pull/53

>  ** Patch: https://github.com/Linaro/odp/pull/53.patch

>  ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc

>  ** Merge commit sha: b3fd065fae878adcf0bcfdd2da6f202214de6d92

>  **/

>  include/odp/api/spec/schedule.h | 5 +++--

>  1 file changed, 3 insertions(+), 2 deletions(-)

> 

> diff --git a/include/odp/api/spec/schedule.h

> b/include/odp/api/spec/schedule.h

> index 8244746d..f1671462 100644

> --- a/include/odp/api/spec/schedule.h

> +++ b/include/odp/api/spec/schedule.h

> @@ -234,8 +234,9 @@ odp_schedule_group_t odp_schedule_group_create(const

> char *name,

>   * Schedule group destroy

>   *

>   * Destroys a schedule group. All queues belonging to the schedule group

> must

> - * be destroyed before destroying the group. Other operations on this

> group

> - * must not be invoked in parallel.

> + * be destroyed before destroying the group. All threads that have joined

> + * the group must leave before destroying the group. Other operations on

> this

> + * group must not be invoked in parallel.

>   *

>   * @param group   Schedule group handle

>   *



Thread may have joined the group initially by being part of the threadmask of schedule_group_create().

odp_schedule_group_t odp_schedule_group_create(const char *name, const odp_thrmask_t *mask)


It would be counter intuitive to require that schedule_group_leave() is called always, as schedule_group_join() may not have been called at all.

-Petri
Bill Fischofer June 16, 2017, 11:49 a.m. | #2
On Fri, Jun 16, 2017 at 5:16 AM, Savolainen, Petri (Nokia - FI/Espoo)
<petri.savolainen@nokia.com> wrote:
>

>

>> -----Original Message-----

>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of

>> Github ODP bot

>> Sent: Thursday, June 15, 2017 11:00 PM

>> To: lng-odp@lists.linaro.org

>> Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api: schedule: add thread

>> removal correction

>>

>> From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

>>

>> Clarify thread removal status from scheduler group

>> before calling odp_schedule_group_destroy.

>>

>> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

>> Reviewed-by: Brian Brooks <brian.brooks@arm.com>

>> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>

>> ---

>> /** Email created from pull request 53 (nagarahalli:api-next-sched-grp)

>>  ** https://github.com/Linaro/odp/pull/53

>>  ** Patch: https://github.com/Linaro/odp/pull/53.patch

>>  ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc

>>  ** Merge commit sha: b3fd065fae878adcf0bcfdd2da6f202214de6d92

>>  **/

>>  include/odp/api/spec/schedule.h | 5 +++--

>>  1 file changed, 3 insertions(+), 2 deletions(-)

>>

>> diff --git a/include/odp/api/spec/schedule.h

>> b/include/odp/api/spec/schedule.h

>> index 8244746d..f1671462 100644

>> --- a/include/odp/api/spec/schedule.h

>> +++ b/include/odp/api/spec/schedule.h

>> @@ -234,8 +234,9 @@ odp_schedule_group_t odp_schedule_group_create(const

>> char *name,

>>   * Schedule group destroy

>>   *

>>   * Destroys a schedule group. All queues belonging to the schedule group

>> must

>> - * be destroyed before destroying the group. Other operations on this

>> group

>> - * must not be invoked in parallel.

>> + * be destroyed before destroying the group. All threads that have joined

>> + * the group must leave before destroying the group. Other operations on

>> this

>> + * group must not be invoked in parallel.

>>   *

>>   * @param group   Schedule group handle

>>   *

>

>

> Thread may have joined the group initially by being part of the threadmask of schedule_group_create().

>

> odp_schedule_group_t odp_schedule_group_create(const char *name, const odp_thrmask_t *mask)

>

>

> It would be counter intuitive to require that schedule_group_leave() is called always, as schedule_group_join() may not have been called at all.


Under the current API definition the thread may not even exist. A
thread mask does not imply that the ids contained in that thread mask
have been created, only that if they are created they will be
considered to be part of this schedule group (create results in an
implicit join). So the statement is correct. If the thread does not
exist then it never joined the group, hence there's no action needed
to leave it. Threads can leave a group in one of two ways: an explicit
odp_schedule_group_leave() call, or terminating. Both have the same
effect. No there's no need to call odp_schedule_group_leave() as these
threads can terminate as well to satisfy this condition.

>

> -Petri

>

>

>

>

Patch hide | download patch | download mbox

diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 8244746d..f1671462 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -234,8 +234,9 @@  odp_schedule_group_t odp_schedule_group_create(const char *name,
  * Schedule group destroy
  *
  * Destroys a schedule group. All queues belonging to the schedule group must
- * be destroyed before destroying the group. Other operations on this group
- * must not be invoked in parallel.
+ * be destroyed before destroying the group. All threads that have joined
+ * the group must leave before destroying the group. Other operations on this
+ * group must not be invoked in parallel.
  *
  * @param group   Schedule group handle
  *