[Bug 523] New: OS_MAX_THREADS name is misleading.

For more infomation about this bug, visit
Summary: OS_MAX_THREADS name is misleading.
Product: RTT
Version: 1.4.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Build System
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [dot] soetens [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

This configuration option suggests that the number of threads in an Orocos
application is bounded. It is certainly not. This number is used by our
lock-free algorithms to allocate enough memory in advance in case
#'OS_MAX_THREADS' threads access the lock-free structure at exactly the same
time. The default is 8, which is already very conservative. Clearly, your
Orocos application may have many more threads than 8. You may lower this number
in order to save memory.3 or 4 are probably safe for most applications.

Some people might have seen this number as a fatal design flaw and abandoned
the RTT for something worse :-)

I propose to rename it to OS_MAX_CONC_ACCESS and mark it as an advanced option
in cmake.

[Bug 523] OS_MAX_THREADS name is misleading.

For more infomation about this bug, visit

Peter Soetens
<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |1.6.0

--- Comment #1 from Peter Soetens
<peter [dot] soetens [..] ...> 2008-03-11 22:14:03 ---
$ svn di src/CMakeLists.txt
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt (revision 29031)
+++ src/CMakeLists.txt (working copy)
@@ -11,7 +11,11 @@
OPTION(OS_HAVE_IOSTREAM "Use C++ iostream library." ON)
OPTION(OS_HAVE_STREAMS "Use C++ streams library." ON)
OPTION(OS_HAVE_MAIN "Provide main() function in rtt library, which sets up the
OS. The user implements ORO_main()." ON)
-SET(OS_MAX_THREADS 8 CACHE STRING "Maximum number of threads in the
application.")
+
+SET(OS_MAX_CONC_ACCESS 8 CACHE STRING "The maximum number of threads that
will access a lock-free resource at exactly the same time. The Default (8) is
very conservative. Your application may have more threads than this number.")
+SET(OS_MAX_THREADS ${OS_MAX_CONC_ACCESS})
+MARK_AS_ADVANCED(FORCE OS_MAX_CONC_ACCESS)
+
OPTION(OS_THREAD_SCOPE "Enable to monitor thread execution times through
ThreadScope API." OFF)
OPTION(CONFIG_FORCE_UP "Enable to optimise for single core/cpu systems." OFF)

+ sspr@lt00129:~/src/Orocos/trunk/rtt
$ svn ci src/CMakeLists.txt -m"Fix bug #523: OS_MAX_THREADS name is misleading.
Rename to OS_MAX_CONC_ACCESS in CMake."
Sending src/CMakeLists.txt
Transmitting file data .
Committed revision 29040.