Such flags as O_DIRECT, O_SYNC, O_DSYNC can be used to specify synchronous / asynchronous IO at the time when descriptor is created (create syscall). But is it possible to use this flags for distinct write (or similar) syscalls in order to make some of them synchronous? Answer is it possible to use this flags for distinct write (or similar) syscalls
Tag: asynchronous
Is time-slicing synchronous or asynchronous and why?
The interruptions that occur as a result of the computer’s chronometer indicating a termination of the time interval assigned to a process (time slice), are they classified as synchronous or asynchronous interruptions? Answer Time interrupts, as hardware interrupts are considered as all hardware interrupts as asynchronous. Despite the fact that this can lead to confusion, let me explain: Synchronous interrupts
Linux asynchronous epoll() server having problems when EPOLLRDHUP occurrs
I’m trying to make an asynchronous web server using epoll() in Linux, but problems occur whenever the event EPOLLRDHUP occurs. When the flag EPOLLONESHOT is not set, the server tries to process a useless event (not EPOLLIN or EPOLLOUT) multiple times during the loop without stopping, which causes the server to be come completely unresponsive (and require a restart). When
Using a signal handler to process datas received from a fifo
I am writing a simple client/server communication with fifo but i am stuck at using a signal handler to process client request. The server open a fifo in readonly and non blocking mode, read datas received and writes back some datas to the client fifo. And this actually works fine when there is no signal handler on the server side.
How to run iterations asynchronously in shell script
I have a few .csv files like below. xyz0900@1#-1637746436.csv xxx0900@1#-1637746436.csv zzz0900@2#-1637746439.csv yyy0900@1#-1637746436.csv sss0900@2#-1637746439.csv I have written a script to perform below tasks: Get the large file based on the pattern which we have passed as a argument to the script. Merge all other files which are having same pattern and create a new file Remove duplicate header from new file.
Script takes parameters from the previous run
I am using docker container that runs Alpine Linux.It runs some bash script async The first time it runs it seems it does nothing it should write to some database but when I run it second time It does work but it use parameters from the previous run i.e param1 and param2. Without &>/dev/null &disown it works fine from the
What is the maximum number of threads that std::async will create and execute asynchronously?
I have a large number (>>100K) of tasks with very high latency (minutes) and very little resource consumption. Potentially they could all be executed in parallel and I was considering using std::async to generate one future for each task. My question is: what is the maximum number of threads that std::async will create and execute asynchronously? (using g++ 6.x on
Linux synchronization without polling
In principle what I want is very simple. Two executables ./read and ./write respectively read and write from a resource (let’s say a file). Using flock(2) it is easy to prevent race conditions between arbitrary invocations of ./read and ./write at arbitrary times. The requirement is that each invocation of ./read contains a snapshot of the resource from a previous
Linux non-blocking sockets
Hello I want to implement non-blocking TCP sockets with an openSSL overlay. For now I use epoll, but isn’t there another methode (except poll or select)? Is it possible to associate a callback function to a descriptor? I read something about libaio, but I don’t know exactly what it can do… Answer I use epoll functions from now on because
C non-blocking keyboard input
I’m trying to write a program in C (on Linux) that loops until the user presses a key, but shouldn’t require a keypress to continue each loop. Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work. Alternatively, is there a way to catch a