9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] why is /dev/mousein exclusive use?
@ 2012-12-10 16:36 Richard Miller
  2012-12-10 16:38 ` erik quanstrom
  2012-12-10 16:48 ` Anthony Martin
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Miller @ 2012-12-10 16:36 UTC (permalink / raw)
  To: 9fans

Is there a good reason to forbid multiple processes to open
the mousein device?  I can't think what trouble it could cause
(writes have to be atomic anyway because the driver will only
parse a complete input), and it makes it awkward to debug
a new mouse driver if a usb mouse is already (or has ever been)
connected.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] why is /dev/mousein exclusive use?
  2012-12-10 16:36 [9fans] why is /dev/mousein exclusive use? Richard Miller
@ 2012-12-10 16:38 ` erik quanstrom
  2012-12-10 17:47   ` lucio
  2012-12-11 15:30   ` Richard Miller
  2012-12-10 16:48 ` Anthony Martin
  1 sibling, 2 replies; 6+ messages in thread
From: erik quanstrom @ 2012-12-10 16:38 UTC (permalink / raw)
  To: 9fans

On Mon Dec 10 11:37:12 EST 2012, 9fans@hamnavoe.com wrote:
> Is there a good reason to forbid multiple processes to open
> the mousein device?  I can't think what trouble it could cause
> (writes have to be atomic anyway because the driver will only
> parse a complete input), and it makes it awkward to debug
> a new mouse driver if a usb mouse is already (or has ever been)
> connected.

can't think of any.  one can already attach 2 mice to a pc,
one ps/2, and one usb.  it works fine.

- erik



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] why is /dev/mousein exclusive use?
  2012-12-10 16:36 [9fans] why is /dev/mousein exclusive use? Richard Miller
  2012-12-10 16:38 ` erik quanstrom
@ 2012-12-10 16:48 ` Anthony Martin
  1 sibling, 0 replies; 6+ messages in thread
From: Anthony Martin @ 2012-12-10 16:48 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Richard Miller <9fans@hamnavoe.com> once said:
> Is there a good reason to forbid multiple processes to open
> the mousein device?  I can't think what trouble it could cause
> (writes have to be atomic anyway because the driver will only
> parse a complete input), and it makes it awkward to debug
> a new mouse driver if a usb mouse is already (or has ever been)
> connected.

IIRC, this restriction was removed in 9front.

  Anthony



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] why is /dev/mousein exclusive use?
  2012-12-10 16:38 ` erik quanstrom
@ 2012-12-10 17:47   ` lucio
  2012-12-11 15:30   ` Richard Miller
  1 sibling, 0 replies; 6+ messages in thread
From: lucio @ 2012-12-10 17:47 UTC (permalink / raw)
  To: 9fans

> can't think of any.  one can already attach 2 mice to a pc,
> one ps/2, and one usb.  it works fine.

I second that, I've had a ps2 mouse and a serial trackball working
side by side.

++L




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] why is /dev/mousein exclusive use?
  2012-12-10 16:38 ` erik quanstrom
  2012-12-10 17:47   ` lucio
@ 2012-12-11 15:30   ` Richard Miller
  2012-12-11 15:45     ` erik quanstrom
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Miller @ 2012-12-11 15:30 UTC (permalink / raw)
  To: 9fans

No objections having been raised, I've submitted a patch
(mousein-non-exclusive) to remove this restriction.

Next, the same question about /dev/kbin - does that need to be
exclusive open?  I think not.  Slightly more complicated, because
kbin can receive a pair of inputs (escape + scancode) and pass them
one at a time to the kbd driver.  But that is already a potential bug,
not prevented by exclusive open - usbd can start driver processes for
two usb keyboards, multiplexing their inputs through one fd to kbin,
and on a multiprocessor the escapes might be incorrectly interleaved.

My proposal is to remove the exclusive open, and instead put a qlock
around the loop which sends codes from kbin to kbd.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] why is /dev/mousein exclusive use?
  2012-12-11 15:30   ` Richard Miller
@ 2012-12-11 15:45     ` erik quanstrom
  0 siblings, 0 replies; 6+ messages in thread
From: erik quanstrom @ 2012-12-11 15:45 UTC (permalink / raw)
  To: 9fans

> My proposal is to remove the exclusive open, and instead put a qlock
> around the loop which sends codes from kbin to kbd.

or, keep a small structure, perhaps in the channel to keep
track of these things.  there's also a limitation where the same
kbmap gets applied to all keyboards.

- erik



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-11 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-10 16:36 [9fans] why is /dev/mousein exclusive use? Richard Miller
2012-12-10 16:38 ` erik quanstrom
2012-12-10 17:47   ` lucio
2012-12-11 15:30   ` Richard Miller
2012-12-11 15:45     ` erik quanstrom
2012-12-10 16:48 ` Anthony Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).