Need help on l4_msgtag_has_error
Hello, Can some one tell me when a msg tag is set to the error code i.e., tag = 0x8000 ? I have a parent thread A, which creates a child thread B, and thread C is assigned as B's pager and exception handler. When thread A destroys B via l4_task_unmap, thread C is invoked and the tag returned from ipc_reply_and_wait cannot pass l4_msgtag_has_error check. This is very weird. When B dies, will it generate some sort of exceptions which will cause C to be invoked? If I ask thread C to ignore this IPC message, it seems fine because thread B is anyway destroyed. But I am still wondering if I did something logically wrong or the tag error can be safely ignored, especially in the situation I described above? Thanks. Chen
On Wed Dec 07, 2011 at 15:56:59 -0800, Chen Tian wrote:
Can some one tell me when a msg tag is set to the error code i.e., tag = 0x8000 ?
I have a parent thread A, which creates a child thread B, and thread C is assigned as B's pager and exception handler.
When thread A destroys B via l4_task_unmap, thread C is invoked and the tag returned from ipc_reply_and_wait cannot pass l4_msgtag_has_error check. This is very weird. When B dies, will it generate some sort of exceptions which will cause C to be invoked?
If I ask thread C to ignore this IPC message, it seems fine because thread B is anyway destroyed. But I am still wondering if I did something logically wrong or the tag error can be safely ignored, especially in the situation I described above?
Which error code does l4_error() return? Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
Hi folks, I'm trying to get some simple modules written just by modifying the existing hello module. I've got a tiny stupid test one written, and I'm getting undefined references for all of my pthread functions, even though I've included all the necessary headers. I'm modifying hello in place -- should I need to make any makefile adjustments to get this to build? Thank you very much! The modified code is below: #include <stdio.h> #include <unistd.h> #include <l4/util/rdtsc.h> #include <pthread-l4.h> #include <pthread.h> void* pthread_func(void* none) { pthread_yield(); return NULL; } int main(void) { l4_cpu_time_t start_time = l4_rdtsc(); pthread_t t[100]; pthread_attr_t a[100]; for (int i = 0; i < 10; ++i) { pthread_attr_init(&a[i]); pthread_attr_setschedpolicy(&a[i], SCHED_L4); pthread_attr_setinheritsched(&a[i], PTHREAD_EXPLICIT_SCHED); if (pthread_create(&t[i], &a[i], pthread_func, NULL)) puts("Everything"); } printf("Cycles elapsed: ", l4_rdtsc() - start_time); }
On Fri Dec 09, 2011 at 23:50:02 -0800, brycecr@gmail.com wrote:
I'm trying to get some simple modules written just by modifying the existing hello module. I've got a tiny stupid test one written, and I'm getting undefined references for all of my pthread functions, even though I've included all the necessary headers.
I'm modifying hello in place -- should I need to make any makefile adjustments to get this to build?
Add REQUIRES_LIBS = libpthread to the Makefile. Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
participants (3)
-
Adam Lackorzynski -
brycecr@gmail.com -
Chen Tian