[Bug 1806] SMP: affinity step #1

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu May 26 17:34:24 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1806

Gedare <giddyup44 at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giddyup44 at yahoo.com

--- Comment #2 from Gedare <giddyup44 at yahoo.com> 2011-05-26 12:34:24 CDT ---
thread.h:
+#define RTEMS_CPU_AFFINITY_ANY (-1)
I'm not sure about a negative default value for an unsigned field (affinity).
Can we use something else like MAX_CPUS or something? This isn't a big deal to
me.

threadinitialize.c:
+int _Thread_SMP_RR_Next_CPU = 0;
This variable does not appear to need to be globally scoped. Please consider
making it static and putting it in the scope of the find_CPU function.

+int _Thread_SMP_Find_CPU(int cpu)
If this function is solely a helper function for Initialize, please consider
making it static.  Also, the name should be _Thread_SMP_find_CPU. If it is not
a helper function, then its prototype should be declared in thread.h

+#ifdef RTEMS_SMP
+  the_thread->core                    = _Thread_SMP_Find_CPU(affinity);
+#endif
Why not just add these lines after the call to _Thread_Initialize where it gets
used? Better yet would be to add an interface for assigning affinity to
threads. _Thread_SMP_get/set/initialize_affinity( ); would be my suggestion.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list