From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 24 14:53:26 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D82B16A420 for ; Tue, 24 Jan 2006 14:53:26 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8E1743D4C for ; Tue, 24 Jan 2006 14:53:19 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k0OErEMc017740; Tue, 24 Jan 2006 07:53:15 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <43D63F5F.9080203@samsco.org> Date: Tue, 24 Jan 2006 07:53:19 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20051230 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pranav Peshwe References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-hackers@freebsd.org Subject: Re: Difference between a kthread and an ordinary process. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 14:53:26 -0000 Pranav Peshwe wrote: > Hello, > When a kthread is created using the kthread_create (9) > function, i found out that a new instance of struct proc is created > and allocated for the thread just as in case of a creation of a new > process.Also, the thread is assigned a pid as in the case of a > process. > What is the difference between a kernel thread and a normal process > created using fork ? except the address space sharing with swapper and > kernel mode execution of the kthread. Is a kthread effectively just a > process always running in kernel mode ? > That is exactly what a kthread is. There is some work in process to make them true threads within one or more processes. Scott