How to open a device for exclusive access?
Bill Sconce
sconce at in-spec-inc.com
Sun Jul 15 11:34:32 EDT 2007
On Sat, 14 Jul 2007 13:28:27 -0400
"Michael ODonnell" <michael.odonnell at comcast.net> wrote:
> I haven't coded this recently but this is a wheel that's
> been invented so many times that I assume there are now
> turn-key packages available to accomplish it. Maybe our
> local Perl/Python aficionados can confirm...
Gaah. No doubt there ARE "turnkey" packages. But development
of any package often tends to get feeping creaturitis, and tends
to get bloated and complex to manage. And tends to do things
like leaving lock files laying around.
Sometimes (most times?) the problem space may be simple enough
that you only have to invent a spoke, not an entire wheel. A
first-blush hope of a Pythonista might be to write a small
program which handles data going to and from the device, and
have upstream processes which need the device communicate with
that program (which can of course ensure that multiple streams
are handled intelligently -- by refusing all but one, e.g.).
But of course the needs of the specific problem space rule.
/reWheelWright Bill
who did plenty of locking and process mutexes in the old days
using bash, before finding out about Python.
(Come to think, the issue in a case like may be not so much
about functionality, which can always be cobbled together somehow,
even in bash, but readability and testability.)
More information about the gnhlug-discuss
mailing list