From owner-acpi-jp@jp.freebsd.org  Thu Dec  6 14:04:59 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id OAA99687;
	Thu, 6 Dec 2001 14:04:59 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (root@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id OAA99676;
	Thu, 6 Dec 2001 14:04:57 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (root@localhost [127.0.0.1])
	(authenticated as iwa with CRAM-MD5)
	by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id fB654tP88565;
	Thu, 6 Dec 2001 14:04:56 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Date: Thu, 06 Dec 2001 14:04:51 +0900 (JST)
Message-Id: <20011206.140451.71081436.iwasaki@jp.FreeBSD.org>
To: acpi-jp@jp.freebsd.org, msmith@freebsd.org
Cc: iwasaki@jp.FreeBSD.org
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
In-Reply-To: <200112052232.fB5MWTJ03359@mass.dis.org>
References: <iwasaki@jp.FreeBSD.org>
	<200112052232.fB5MWTJ03359@mass.dis.org>
X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1523
Subject: [acpi-jp 1523] Re: Call for testers: Semaphore and Thread
 implementaion 
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi,

> > My concern about current implementation is that task queue kernel
> > thread is shared with some other drivers and we cannot estimate how long
> > does it take to complete the interpreter execution. 
> 
> Whilst most drivers should not expect the generic task queue to
> run/complete within any given period of time, I'm basically in
> agreement with you here.

OK, thanks.

> > I think having dedicated thread for interpreter and giving chance to
> > execute tasks for other drivers is not so bad idea.
> 
> You could just implement a private task queue for the interpreter. That'd
> be pretty straightforward.

Yeah, I think this is what I wanted to change :-)
but it seemed to me that creating kernel thread is easier than
private task queue implementation.
Now I've made additional code for it.  looks good?
Should we have SWI_ACPI priority instead of SWI_TQ?

----
/*
 * Private task queue definition for ACPI
 */
TASKQUEUE_DECLARE(acpi);
static void	*taskqueue_acpi_ih;

static void
taskqueue_acpi_enqueue(void *context)
{  
    swi_sched(taskqueue_acpi_ih, SWI_NOSWITCH);
}

static void
taskqueue_acpi_run(void *dummy)
{
    taskqueue_run(taskqueue_acpi);
}

TASKQUEUE_DEFINE(acpi, taskqueue_acpi_enqueue, 0,
		 swi_add(NULL, "acpi task queue", taskqueue_acpi_run, NULL,
		     SWI_TQ, 0, &taskqueue_acpi_ih));
----

One more thing, how about having multi threads for ACPI task execution?
I'm not sure about this...  it has some advantages in MP environment but
it makes things complex.

Thanks
