On 9/4/19, Keith Medcalf <kmedc...@dessus.com> wrote:
>
> On Wednesday, 4 September, 2019 04:40, Peng Yu <pengyu...@gmail.com> wrote:
>
>>The command line program `lockfile` locks based on files. I wants to do the
>>same thing but based on a row in a table. For example (this is just one
>>example feature, but all other features should also be preserved), if a
>>given row is there, the process will hang unless some other process delete
>>the given row. Multiple processes can compete for the same row. Because
>>program like this should deal with concurrency, I am not clear how to make
>>it bug free. Does anybody has a ready-to-use solution? Thanks.
>
> Lockfile is a program that implements lockfiles for *nix shell scripts.  Why
> would you want to re-create that?  If you want to co-ordinate access to
> something between processes and/or threads in programs written in C then why
> not just use the OS provided named semaphore interface and skip all the
> extra complication (and let the OS do all the work, that’s why it was
> written)?

I use lockfile to ensuring one process runs when dealing with file
dependencies (as in build systems such as make which takes care of
file dependencies). Now I put some files in sqlar. Therefore, I'd like
to have something as a natural extension of lockfile's feature to deal
with files in sqlar. However, since sqlite db is locked per file,
there is no way to concurrently change two files in sqlar anyway. In
this sense, my question seems not to matter anymore.

-- 
Regards,
Peng
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to