From owner-freebsd-hackers Thu Feb 26 11:43:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA07801 for freebsd-hackers-outgoing; Thu, 26 Feb 1998 11:43:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from euthyphro.uchicago.edu (euthyphro.uchicago.edu [128.135.21.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA07740 for ; Thu, 26 Feb 1998 11:43:39 -0800 (PST) (envelope-from sfarrell@phaedrus.uchicago.edu) Received: from phaedrus.uchicago.edu (phaedrus [128.135.21.10]) by euthyphro.uchicago.edu (8.8.6/8.8.4) with ESMTP id NAA13264; Thu, 26 Feb 1998 13:43:37 -0600 (CST) Received: (from sfarrell@localhost) by phaedrus.uchicago.edu (8.8.8/8.8.5) id NAA13325; Thu, 26 Feb 1998 13:43:31 -0600 (CST) To: "Alfred Perlstein" Cc: Subject: Re: so how goes java? References: <02f901bd424a$33dd5bc0$0600a8c0@win95.local.sunyit.edu> From: stephen farrell Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: 26 Feb 1998 13:43:31 -0600 In-Reply-To: "Alfred Perlstein"'s message of "Wed, 25 Feb 1998 19:05:04 -0500" Message-ID: <87u39mrw2k.fsf@phaedrus.uchicago.edu> Lines: 46 X-Mailer: Gnus v5.5/XEmacs 20.3 - "Vatican City" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Alfred Perlstein" writes: > >> >They are not pre-emptive. > >> > >> (figures since until recently the SUN version was also co-operative) > >> one of my first things (besides fixing this problem) is to look into > native > >> threads, co-operative multitasking is an oxymoron. > >> i also plan on having several snapshots of 3.0 compiled versions of the > >> port. i'll inform the porting team when my NDA is all set and good. > > > >Do not confuse call conversion threading with Yield-based threading. > > > >Though call conversion threading is non-preemptive, one thread will > >not be blocked simply because another thread has made a blocking > >call. This is the point of call conversion. > > > >Kernel threading buys you SMP scalability (assuming there is ever > >code changes checked in to ensure thread-CPU affinity), and a much > >higher context switch overhead. > > ummm I think you just caused my brain to hemorrhage... :) > but let me try to rephrase that just to make sure i understand. > > if we have 2 threads busy looping, for instance just printing "i'm thread A" > and "i'm thread B", whichever thread starts first will not allow the other > thread to execute, correct? > > however if one thread tries to do a disk access or something that could > possibly block like a socket operation, the other thread will be allowed to > start executing? > > ok, so what do I need to do to get a situation where the threads would > alternate printing "i'm thread A" and "i'm thread B" when they are just busy > looping? I'm assuming you're still talking about java... if so, then the o'reilly java threads book covers many of these issues rather effectively... setting up a high-priority scheduler thread, as nate suggested, is covered in there. in fact, you might find such examples from the book at the ora website. -- Steve Farrell To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message