Execution order


Let’s say I have 10 recurring jobs that will trigger at the exact same time (same cron).
They will trigger in the same queue, but this queue only has 1 worker.

My 10 executions will be processed sequentially.

What I’d like to know is in what order. I guess it should be random. But random doesn’t exist with computers.
Will it be respecting their order in the database, hence based on each recurring job creation date ?
Or is it anything else ?


Here’s the select to fetch a job from JobQueue table

delete top (1) from [{0}].JobQueue with (readpast, updlock, rowlock)
where (FetchedAt is null or FetchedAt < DATEADD(second, @timeout, GETUTCDATE()))
and Queue in @queues

Thanks for your reply.

What I get from this select is that jobs will be proceeded in the same order they were enqueued.

So the new question is : In what order are they enqueued ?

As soon it gets from database