Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to process one lock after each other? #87

Open
mgutt opened this issue Oct 14, 2020 · 2 comments
Open

How to process one lock after each other? #87

mgutt opened this issue Oct 14, 2020 · 2 comments

Comments

@mgutt
Copy link

mgutt commented Oct 14, 2020

The following command does not make sense, as the first execution leaves vmtouch open:

vmtouch -l /file1
vmtouch -l /file2
vmtouch -l /file3

So instead I need to use the daemon mode:

vmtouch -d -l /file1
vmtouch -d -l /file2
vmtouch -d -l /file3

But by that all daemons are executed parallel (which can overload the CPU). Is it possible to wait until one lock command has been finished, before starting the next one?

The following solution works, but adds much more sleep time as it would be necessary:

vmtouch -d -l /file1
sleep 60
vmtouch -d -l /file2
sleep 60
vmtouch -d -l /file3
@hoytech
Copy link
Owner

hoytech commented Oct 15, 2020

In this particular example could you not do:

vmtouch -l /file1 /file2 /file3

This will mlock() each file in sequence.

@hoytech
Copy link
Owner

hoytech commented Oct 15, 2020

Oh and by the way, you can background a process with "&" in your shell to avoid daemonizing. Daemonizing will actually put the daemon process into a separate session, which is often not what is desired:

vmtouch -l /file* &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants