TWINE utility library

There are few operations that are real-time safe for traditional OSes but are not under Xenomai, for example accessing system timers, few thread operations, etc.

For those purposes, we created the TWINE library, which also offers a high-level Worker Pool abstraction for exploiting multiple cores from inside a single plugin:

TWINE is also used internally by SUSHI and can be compiled for POSIX systems like traditional Linux and macOS.

1 Like

Hello @Stefano,

Is there any documentation for the thread functions in TWINE? I am getting my information by reading test/stresstest/stresstest.cpp.

Take care,

  • Rick Cohen

HI Rick,
the public header has full Doxygen comments on all the methods, isn’t that enough?

It’s a pretty simple worker pool scheme, you create workers and pass callback + data pointer to each one of them. You can also look at how it’s used inside SUSHI for other use cases.

Hi @Stefano,

OK, so we never need to call __cobalt_pthread_create() or __cobalt_pthread_join()?

If that is true, it seems pretty simple.


  • Rick

No. The whole point of the library is to abstract away those things for you. TWINE has a fallback implementation (using standard POSIX threads) that can be used for normal Linux and some people have used it successfully on macOS, too.