I'm new to Linux technologies and bash scripting.

For now, I have a simple bash script that extract one subtitle track from a given MKV using mkvextract.

I was wondering: if multiple users were using this script (via the bash command, for example) at the same time, on the same or a different mkv file, how would Linux react to this?

Does it create a "sequencing system" on his own or does it process every command in parallel ?


This is a job for process scheduler (also, see this).

Generally, when you use any command, one can say(without going into too much detail) that you ask Linux kernel(think OS) to create a separate process that will handle its job.

Now the process is put in queue, and then all processes are granted access to PC's resources. This is handled by some scheduling algorithm. The simplest one I can think of is FIFO - First in, First out - the first one to ask is the first one who gets resources. You give resources for a short period of time, then put it back in the queue.

As for processing in parallell: it depends. Generally Linux makes use of multiple cores, and you can say that some tasks are done in parallell, but many of tasks are done by creating an illusion of parallell execution - they are just switched so fast you think they're paralell.

To answer your question fully: when you extract data, it's probably just read, not deleted - so multiple commands on the same, or different mkv, that only perform reading shouldn't be an issue.

For more informations you can google "Scheduler", "Linux Scheduler".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.