in reply to Semaphore puzzle

Maybe I'm misunderstanding the problem. Why don't you lock one of the files or the database table you're importing into (or both)? You have a defined order in which they should be imported, so the program that gets launched to import the (defined) first file locks the file (and the table). The second program launched finds the file/table locked and just exits.

Replies are listed 'Best First'.
Re^2: Semaphore puzzle
by jerryhone (Sexton) on Feb 23, 2021 at 09:21 UTC
    It's all down to timing. There isn't the time to implement a lock (or a semaphore) before the other file is returned.
    I've reconsidered a complete redesign based on what I've encountered here, but there are multiple other moving parts and I have to go with what I have - for the moment anyway.