Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 2002 08:52:33 +0200 (CEST)
From:      Harti Brandt <brandt@fokus.gmd.de>
To:        Maksim Yevmenkin <m_evmenkin@yahoo.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Device cloning
Message-ID:  <20020611085001.G33171-100000@beagle.fokus.gmd.de>
In-Reply-To: <20020610211347.71117.qmail@web13305.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Jun 2002, Maksim Yevmenkin wrote:

MY>Hackers,
MY>
MY>The project i'm working on might require some sort of
MY>device cloning. The current way of cloning, i.e. use
MY>DEVFS and allocate unique minor numbers, is not very
MY>good for my purpose.
MY>
MY>The idea is simple: the same device(major,minor) can
MY>be opened several times by different processes (or
MY>possibly threads within the same process) and each
MY>process (thread) will have unique device instance.
MY>Device driver will create new instance, every time
MY>open() called. It will use D_TRACKCLOSE flag and
MY>destroy instances in close().
MY>
MY>What kind of information should i store to identify
MY>each instance? Is/Will it be possible to identify a
MY>single thread within a process? Is there any problems
MY>with fork()? The support for the threads is optional.
MY>I can live with single instance per process.

In MHO this idea is based on a fundamental misunderstanding of what a
device is under unix. If you need such a behaviour you should put another
abstraction on top of you devices (as the filesystem is put on top of
disks and sockets on top of network devices), that handle multiple
contexts for multiple processes. A device is just a device...

harti
-- 
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
              brandt@fokus.fhg.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020611085001.G33171-100000>