Show EOL distros: 

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

ecl_core: ecl_command_line | ecl_concepts | ecl_containers | ecl_converters | ecl_core_apps | ecl_devices | ecl_eigen | ecl_exceptions | ecl_formatters | ecl_geometry | ecl_ipc | ecl_linear_algebra | ecl_math | ecl_mpl | ecl_sigslots | ecl_statistics | ecl_streams | ecl_threads | ecl_time | ecl_type_traits | ecl_utilities

Package Summary

This package provides the c++ extensions for a variety of threaded programming tools. These are usually different on different platforms, so the architecture for a cross-platform framework is also implemented.

Features

  • Mutex - multi-thread variable protection.

  • Thread - raii style one-shot thread class.

  • Threadable - an inheritable thread interface.

There are also a few methods for setting thread/process priorities.

Cross Platform Support

Currently the windows code is available, but not currently present (need to port it from the old version of ecl) because it isn't getting used/tested frequently. It can be added back in when and as needed quickly as the framework is still in place.

Compiling & Linking

Include the following at the top of any translation unit:

   1 #include <ecl/threads.hpp>
   2 
   3 // The thread classes
   4 using ecl::Mutex;
   5 using ecl::Thread;
   6 using ecl::Threadable;
   7     
   8 // Priorities
   9 using ecl::set_priority;
  10 using ecl::get_priority;
  11 using ecl::print_priority_diagnostics;
  12 using ecl::BackgroundPriority;
  13 using ecl::LowPriority;
  14 using ecl::NormalPriority;  
  15 using ecl::HighPriority;    
  16 using ecl::CriticalPriority;
  17 using ecl::RealTimePriority1;   
  18 using ecl::RealTimePriority2;   
  19 using ecl::RealTimePriority3;   
  20 using ecl::RealTimePriority4;   

If using catkin with ROS, you should make sure to declare a dependency on ecl_threads in your package.xml and find_package ecl_threads in your CMakeLists.txt:

find_package(catkin REQUIRED COMPONENTS
   ecl_threads
   # other dependencies ...
)

If outside ros, you will also need to link to ecl_threads.

Tutorials

  • Thread : threading functionality via composition.

  • Threadable : threading functionality via inheritance.

  • Thread Locks : locking threads to protect shared data.

  • Priorities : setting thread or process scheduling priorities.

Wiki: ecl_threads (last edited 2014-11-24 18:41:08 by AustinHendrix)