[Openmp-commits] [openmp] r258990 - Restore th_current_task first as suggested by John Mellor-Crummey

Hans Wennborg via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 28 09:59:56 PST 2016


Yes, go ahead and merge with utils/release/merge.sh (or let me know if
you'd prefer me to do it.)

Thanks,
Hans

On Thu, Jan 28, 2016 at 8:43 AM, Peyton, Jonathan L via Openmp-commits
<openmp-commits at lists.llvm.org> wrote:
> Hans,
>
> Can this be merged into 3.8?
>
> -- Johnny
>
> -----Original Message-----
> From: Openmp-commits [mailto:openmp-commits-bounces at lists.llvm.org] On Behalf Of Jonathan Peyton via Openmp-commits
> Sent: Wednesday, January 27, 2016 3:20 PM
> To: openmp-commits at lists.llvm.org
> Subject: [Openmp-commits] [openmp] r258990 - Restore th_current_task first as suggested by John Mellor-Crummey
>
> Author: jlpeyton
> Date: Wed Jan 27 15:20:26 2016
> New Revision: 258990
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258990&view=rev
> Log:
> Restore th_current_task first as suggested by John Mellor-Crummey
>
> If an asynchronous inquiry peers into the runtime system it doesn't see the freed task as the current task.
>
> Modified:
>     openmp/trunk/runtime/src/kmp_tasking.c
>
> Modified: openmp/trunk/runtime/src/kmp_tasking.c
> URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_tasking.c?rev=258990&r1=258989&r2=258990&view=diff
> ==============================================================================
> --- openmp/trunk/runtime/src/kmp_tasking.c (original)
> +++ openmp/trunk/runtime/src/kmp_tasking.c Wed Jan 27 15:20:26 2016
> @@ -690,13 +690,12 @@ __kmp_task_finish( kmp_int32 gtid, kmp_t
>      }
>
>      // Free this task and then ancestor tasks if they have no children.
> +    // Restore th_current_task first as suggested by John:
> +    // johnmc: if an asynchronous inquiry peers into the runtime system
> +    // it doesn't see the freed task as the current task.
> +    thread->th.th_current_task = resumed_task;
>      __kmp_free_task_and_ancestors(gtid, taskdata, thread);
>
> -    // FIXME johnmc: I this statement should be before the last one so if an
> -    // asynchronous inquiry peers into the runtime system it doesn't see the freed
> -    // task as the current task
> -    __kmp_threads[ gtid ] -> th.th_current_task = resumed_task; // restore current_task
> -
>      // TODO: GEH - make sure root team implicit task is initialized properly.
>      // KMP_DEBUG_ASSERT( resumed_task->td_flags.executing == 0 );
>      resumed_task->td_flags.executing = 1;  // resume previous task
>
>
> _______________________________________________
> Openmp-commits mailing list
> Openmp-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-commits
> _______________________________________________
> Openmp-commits mailing list
> Openmp-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-commits


More information about the Openmp-commits mailing list