Hello

        I am trying to buid support for another type of password databases
(/etc/passwd and /etc/shadow are _slow_ for >2k users). I am trying to put
these in a gdbm file. Since I intend to write a thread-safe code (I think
I know what this means, but I'm not very sure), I'd really like to get rid
of setpwent, getpwent and endpwend, since accessing gdbm's is pretty
quick, and because I don't know if these functions wouldn't break the
safeness of the code. gdbm manages its own locks, at least this
is what TFM says. 
        Is this schema thread-safe:

- setpwent opens the gdbm (in read mode)
- look for something in the database, sequentially, using some sort of
getpwent
- close the database (with endpwent)

        IMHO, it should be, since the read would allow other concurrent
reads (even in other threads, I think), and no write, so no key
reorganizing.

        Any opinion is appreciated.

Best wishes, 


                                                Mihai

        Mihai Ibanescu                  Dynamic Network Technologies 
http://sysadm.dntis.ro/~misa          Moara de Foc 35, et. 7, 6600 Iasi
        [EMAIL PROTECTED]                       tel. +40-32-252936

Reply via email to