[Beowulf] Kernel_thread problem

Zhang Hui spacetiller at 163.com
Tue Nov 1 08:46:09 EST 2005

	I have forked two thread in kernel state with the function kernel_thread:
	But i find it's hard to stop them with the function following:

	int stop_myfunc1(void)
	DECLARE_WAITQUEUE(wait, current);

	if (!myfunc1_pid)
		return -ESRCH;

	IP_VS_INFO("stopping myfunc1 thread %d ...\n", myfunc1_pid);

	add_wait_queue(&stop_myfunc1_wait, &wait); //stop_myfunc1_wait declared before
	remove_wait_queue(&stop_myfunc1_wait, &wait);

	/* it is probably not correct here. we need use sys_wait4, but need
	to patch the kernel to export sys_wait4, check it later...
	sys_wait4(myfunc1_pid, NULL, __WCLONE, NULL); */

	waitpid(myfunc1_pid, NULL, __WCLONE);

	return 0;
    int stop_myfunc2(void) { /* the same with above */ }
	What's the problem?

        Zhang Hui
        spacetiller at 163.com

Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

More information about the Beowulf mailing list