Skip to content
Advertisement

Tag: concurrency

how to output only when command finish

I’m running multiple commands using &: This doesn’t work well because the output lines are interleaved. I want each curl to hold its output, until it’s done. How to do that? I understand I can use temp files, concat together and delete afterwards. Are there better ways? Answer You could execute each curl inside a subshell: 2>&1 redirects stderr to

access order of std::atomic bool variable

I’ve a function that accesses(reads and writes to) a std::atomic<bool> variable. I’m trying to understand the order of execution of instructions so as to decide whether atomic will suffice or will I’ve to use mutexes here. The function is given below – I’ve read this page on cppreference which mentions – Each instantiation and full specialization of the std::atomic template

Safe global state for signal handling

I am toying around with Rust and various UNIX libraries. A use-case that I have right now is that I want to react to POSIX signals. To keep things reasonable I want to create an abstraction over the signal handling so that the rest of my program doesn’t have to worry about them as much. Let’s call the abstraction SignalHandler:

Advertisement