On May 17, 2005 11:54 PM, Jeff Dike wrote:
>> In UML,when the kernel_thread was called,the UML kernel thread P will
>> be created in copy_process. And the corresponding host thread Q will
>> be create in copy_thread_tt. Then the host thread Q will run its
>> SIGUSR1 signal handler new_thread_handler,which will call
>> run_kernel_thread function and exited at last. But I think it should
>> be the UML kernel thread P that call run_kernel_thread function, any
>> problems?
> P and Q are the same thing, so it makes no sense to say the handler should
be run in one rather than the other.
But P and Q are different threads and they will be scheduled
differently,right?
Another question:
when a kernel thread is created in UML, in the function outer_tramp the temp
thread A will clone the corresponding host thread B and then wait for it to
stop. The code is following:
t->pid = clone(t->tramp, (void *) t->temp_stack + page_size()/2,
t->flags, t->tramp_data);
if(t->pid > 0) wait_for_stop(t->pid, SIGSTOP, PTRACE_CONT, NULL);
And once the host thread B is created it will run new_thread_proc,in the
function the thread send the signal SIGUSR1 to itself:
os_usr1_process(os_getpid());
change_sig(SIGUSR1, 1);
return(0);
But I found the thread B will be blocked in the function change_sig(SIGUSR1,
1). Why?
And in the function outer_tramp, the thread A see the thread B was stopped
with a SIGSTOP signal. Why? Since the thread B is blocked by the signal
SIGUSR1...
Thanks a lot!
Alex
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel