From owner-freebsd-questions Wed Jul 4 20:37:13 2001 Delivered-To: freebsd-questions@freebsd.org Received: from web10702.mail.yahoo.com (web10702.mail.yahoo.com [216.136.130.210]) by hub.freebsd.org (Postfix) with SMTP id 7822437B405 for ; Wed, 4 Jul 2001 20:37:11 -0700 (PDT) (envelope-from bhatt_manas@yahoo.com) Message-ID: <20010705033711.6522.qmail@web10702.mail.yahoo.com> Received: from [203.200.52.16] by web10702.mail.yahoo.com; Wed, 04 Jul 2001 20:37:11 PDT Date: Wed, 4 Jul 2001 20:37:11 -0700 (PDT) From: Manas Bhatt Subject: how a context switch happens FreeBSD To: freebsd-questions@FreeBSD.ORG MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hi all, I am still hazy about the operation of a context switch in FreeBSD or as a matter of fact any unices like OS(even after reading relevant books). My questions are the following :-- 1. In all timesharing OS, there is a fixed time slice allocated to each process. When the time expires and the process hasn't finished execution , a context switch happens. Now while the process is executing it receives a interrupt, "the time remains the same as it was before the interrupt happened and after the handling of interrupt OR the time reduces ie. it includes the time required for handling the interrupt". 2. System calls are executed in kernel mode , which AFAIK can't be context switched because the kernel data structures would then be in an inconsistent state. But i have seen while writing network programs that read,write and accept system calls being context switched. How is the consistency of kernel data structures maintained?? anyhow actual code digging would be of great help. only directions are required. thanks manas __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message