Hi Jan, On 01/31/2015 08:36 PM, Jan Mareš wrote: > I'm working on porting the QEMU to the HelenOS and I need the pthread > functionality. What I thought I could do was base pthread implementation > on existing thead_ functions and extend them to support join, detach and > return values. Sadly I discovered the function thread_get_id is behaving > rather strangely. It seems like it sometimes returns a different id. > Another possibility is that the stack is corrupted. Is this still a > supported functionality, or are fibril_ functions supposed to substitute > those? Please find attached a test which is failing for me. Correct me > if my assumptions are wrong.
Assuming you are creating threads using thread_create(), I think you are hitting: #9 Current fibril model can confuse kernel's view on threads http://trac.helenos.org/ticket/9 What most likely happens is that the current fibril gets migrated to another thread when it blocks. This is to be expected due to the way our async framework works. With the async framework, the normal threads become something like execution containers, or, if you like, virtual CPUs, where fibrils can execute. One either stays away of the async framework completely and then threads are the primary execution entities, or one uses async framework and fibrils are the primary execution entities. Most of the HelenOS uspace uses fibrils and async framework. The only exception is ns. HTH, Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
