Since your original e-mail I have implemented a per-driver locking option in LiS.

It works like this:

In the Config file entry for your driver you put a line such as the following, supposing that your driver's name is "foo":

qlock driver foo 3

The numerical values range from 0 to 3.

0 = No locking
1 = Lock each queue (read/write) independently (default)
2 = Lock eqch queue pair together
3 = Use a global lock

The "lock" in this case is a semaphore.  It is used to protect calls to the driver's put() and srv() routines.

You can accomplish your goal by specifying the value "3" for this option.

Other drivers can run with less restrictive locking.

You do not have to worry about open and close, LiS synchronizes those routines.  Your put() and srv() routines cannot be called until your driver open() completes.  LiS synchronizes the closing function by flushing messages and invoking your driver's close() routine.

This is not released officially but you can play with it by downloading LiS-2.17.H.  It will be official in LiS-2.18.

-- Dave

At 02:37 AM 5/4/2004, Golbach, Klaus wrote:

Hallo Dave,
Thank You for Your last hint. It was my break through and I found a simple way to achieve my goal. I implemented, tested it and send now a short documentation.
Please would You read it and send some answer. May be, You have some proposals, remarks or critics.
I would like to test my changes with a real streams driver. We did not port yet our drivers to Linux. So I do not have one. Can You give me a proposal for a driver, and where I can get it. Hopefully I can do my tests with a not so complicated testenvironment.

I wanted to send also the changed files, but they will have nearly 1/2 Mbyte. I would not fill Your mailbox with this stuff. So please tell me, how I can deliver it to You.

best regards
     Klaus Golbach



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.663 / Virus Database: 426 - Release Date: 4/20/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.663 / Virus Database: 426 - Release Date: 4/20/2004

Reply via email to