From d507c0373168e6375b1e876d79730bff8020cb58 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 3 Apr 2014 12:55:43 -0500 Subject: Disable per task variables when SMP is enabled Per task variables are inherently unsafe in SMP systems. This patch disables them from the build and adds warnings in the appropriate documentation and configuration sections. --- doc/user/task.t | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'doc/user/task.t') diff --git a/doc/user/task.t b/doc/user/task.t index 40759fcaf6..a172a0c67b 100644 --- a/doc/user/task.t +++ b/doc/user/task.t @@ -1,5 +1,5 @@ @c -@c COPYRIGHT (c) 1988-2008. +@c COPYRIGHT (c) 1988-2014. @c On-Line Applications Research Corporation (OAR). @c All rights reserved. @@ -340,6 +340,13 @@ containing the task's private "global" data. A critical point with per-task variables is that each task must separately request that the same global variable is per-task private. +@b{WARNING}: Per-Task variables are inherently broken on SMP systems. They +only work correctly when there is one task executing in the system and +that task is the logical owner of the value in the per-task variable's +location. There is no way for a single memory image to contain the +correct value for each task executing on each core. Consequently, +per-task variables are disabled in SMP configurations of RTEMS. + @subsection Building a Task Attribute Set @cindex task attributes, building @@ -1779,6 +1786,9 @@ is to have a single task variable that is a pointer to a dynamically allocated structure containing the task's private `global' data. In this case the destructor function could be `free'. +Per-task variables are disabled in SMP configurations and this service +is not available. + @page @subsection TASK_VARIABLE_GET - Obtain value of a per task variable @@ -1832,6 +1842,9 @@ will optimize it correctly. In this case both the pointer @code{task_variable_value} and data referenced by @code{task_variable_value} should be considered volatile. +Per-task variables are disabled in SMP configurations and this service +is not available. + @page @subsection TASK_VARIABLE_DELETE - Remove per task variable @@ -1874,4 +1887,6 @@ This directive removes the given location from a task's context. @subheading NOTES: -NONE +Per-task variables are disabled in SMP configurations and this service +is not available. + -- cgit v1.2.3