Hi Daniel,
Can someone explain the current limitations of NOUX? I set up my own NOUX package, then tried to call POSIX sleep and got the error "Invalid attempt to create a thread besides main". Why is this?
Noux is meant as a solution to enable the use of command-line-based GNU software on Genode. I am referring to classical Unix software such as compilers, shells, and utilities that interact with each other using pipes and files.
This is where Noux draws its line. It does not even attempt to provide functionalities that go beyond the scope of Unix.
I also see that pthreads are not functional for NOUX. Is there a specific reason for this? Can you tell me what your roadmap for NOUX is?
POSIX threads would make Noux more complex but bring not much benefit. None of the tools we want to use with Noux requires them. My personal stance on the subject is that most use cases for 'pthreads' in the world of Unix can and should be accommodated with classical Unix mechanisms (e.g., using select, fork, and pipes). If your application requires POSIX threads (as is the case for many GUI applications, or a Java virtual machine, or other runtimes), it is better to run it as a normal Genode component w/o using Noux. In this case, the 'pthread' library in the 'libports' repository might be a good starting point.
Do you think that this line of thinking is reasonable?
Regarding your question about the road map, the Noux development is driven by the programs that we want to use. In the previous months, we concentrated on enabling the functionality needed to run the Genode tool chain. There is work in progress to bring Git to Noux as well. We will continue to address all the programs that we need to use Genode as a development environment.
Whereby we have originally focused our attention on mere functionality, we just started to look into optimizations. For example, we recognized that executing the Genode tool chain on Noux is slower than on Linux. Consequently we are investigating ways to detect the bottlenecks and speed it up. Until mid 2013, we plan to add support for starting Genode subsystems out of a Noux environment. So the worlds of Noux and plain Genode components will come closer together.
However, multi-threaded Noux applications are not on the list. That said, I do not want to discourage your from trying to add pthread-support into Noux yourself. Maybe I am wrong and this addition is less complex than I think?
Coming back to your question about sleep. In this case, the 'sleep' function uses the libc's default implementation, which tries to spawn a timer thread on the first call. On Noux, we detect (and prevent) the creation of threads other than the main thread. So we would need to override the default 'sleep' function. This is apparently missing since 'sleep' remained unused by all the Noux programs that we ported so far. If you like to see it added, would you like to open a new topic in our issue tracker?
Cheers Norman