in reply to Re: atomic tie?
in thread atomic tie?

perl is a serial process.

Have you not heard of threads, coros and signal handlers? (There are surely others.)

Replies are listed 'Best First'.
Re^3: atomic tie?
by perlfan (Parson) on Aug 24, 2024 at 08:58 UTC
    Yes, but perl itself is fundamentally a single process. All that other stuff is to avoid the inherent lack of thread safety. I understand it was never meant to be thread safe, so don't take that as a criticism.

      Yes, but perl itself is fundamentally a single process.

      What does that mean??? What does that have to do with anything???

      You said "If your getting a race condition, it's between 2 or more forked perl processes". This is clearly wrong. At so many levels.

      Even if Perl was single process and single threaded and didn't have coros and didn't have signals and didn't have async IO and ... Even if all that, a race condition is still possible. The OP is talking about a database, so there could be a race with other users of the database!

        OP didn't give much information. If it's a single perl process then the race condition would be in the database. If he is using fork (e.g.,) and making the DB calls inside of one of the 2+ perl processes this implies, then he could have a race condition. No? Can't tell unless we get more information.