c - Best choice to recover a unix device driver by killing a kthread -
i don't see kthread_destroy linux, netbsd.
which best approach kill kthread , start again ?
linux doesn't support killing kernel thread. ask stop, wait (there's no provision buggy kernel modules). way, doesn't disappear leaving system resources -- locks, allocated memory, , forth -- in indeterminate state.
typically use kthread_create create thread, , kthread_stop ask thread stop. meanwhile thread sits in loop doing this:
while (!kthread_should_stop()) { /* ... stuff */ } return 0;
Comments
Post a Comment