Questions tagged [nonblocking]

Non-blocking mode I/O either transfers at least one byte or returns immediately with an error or end of stream. Non-blocking algorithms refer to use of concurrency without the usual mutual exclusion primitives, guaranteeing that thread operations will not block indefinitely. This is usually handled with atomic value modification (increment/decrement) and/or reading (compare-and-exchange) operations.. It isn't clear which this tag is intended for.

1597 questions
8
votes
3 answers

how to execute programs in non-blocking way from scripts

I have series of program files, a.out, b.out, c.out I want to execute them one after the other after certain delay between each program. like ./a.out -input parameters ----wait for 50 sec---- ./b.out -input parameters -----wait for 100…
cathy
  • 81
  • 1
  • 1
  • 2
8
votes
1 answer

Proper way of dealing with blocking code using Kotling coroutines

Suppose I have a blocking function because of some third party library. Something along these lines: fun useTheLibrary(arg: String): String { val result = BlockingLibrary.doSomething(arg) return result } Invocations to…
Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
8
votes
1 answer

SSH module for python

I have to do a job (using my web server) on a remote machine that takes about 10 minutes. I have used pxssh module in python for the same but it gives me "timeout error"(non blocking). Now, I am using paramiko but that comes back as soon as it gives…
Jatin Kumar
  • 2,635
  • 9
  • 36
  • 46
8
votes
2 answers

Non-blocking thread that runs an external process

I have created a Java GUI application which functions as a wrapper for many low level external processes. The utility works as is, but is in desperate need of one major improvement. I want my external process run in a non-blocking manner which…
Rodney
  • 117
  • 1
  • 6
8
votes
3 answers

Can regular file reading benefited from nonblocking-IO?

It seems not to me and I found a link that supports my opinion. What do you think?
Cheng
  • 4,816
  • 4
  • 41
  • 44
8
votes
4 answers

What is the difference between a blocking and non-blocking read?

Add to the above question the concept of a wait/no wait indicator as a parameter to a ReadMessage function in a TCP/IP or UDP environment. A third party function description states that: This function is used to read a message from a queue which…
user553514
  • 217
  • 2
  • 4
  • 14
8
votes
3 answers

Bash script with non-blocking read

I want to send some data to a root process with a named pipe. Here is the script and it works great: #!/bin/sh pipe=/tmp/ntp if [[ ! -p $pipe ]]; then mknod -m 666 $pipe p fi while true do if read line <$pipe; then …
michelemarcon
  • 23,277
  • 17
  • 52
  • 68
8
votes
1 answer

Usage of builtin sched module's non-blocking scheduler.run() method?

I'd like to understand how to use the optional parameter blocking in the method scheduler.run(blocking=True). Any practical/real-world example would be very helpful. Based on the research I've done so far, the intention of the blocking optional…
dawranliou
  • 141
  • 2
  • 8
8
votes
2 answers

missing messages when reading with non-blocking udp

I have problem with missing messages when using nonblocking read in udp between two hosts. The sender is on linux and the reader is on winxp. This example in python shows the problem. Here are three scripts used to show the problem. send.py: import…
lgwest
  • 1,347
  • 5
  • 16
  • 26
8
votes
2 answers

Non-blocking concurrent collection?

System.Collections.Concurrent has some new collections that work very well in multithreaded environments. However, they are a bit limited. Either they block until an item becomes available, or they return default(T) (TryXXX methods). I'm needing…
user1228
8
votes
3 answers

Creating non-blocking socket in python

I was trying to understand how non-blocking sockets work ,so I wrote this simple server in python . import socket s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('127.0.0.1',1000)) s.listen(5) s.setblocking(0) while True: try: …
Gray
  • 267
  • 1
  • 6
  • 12
8
votes
1 answer

How can I determine if a non-blocking socket is really connected?

This question is not limited to Python. Its a general socket question. I have a non-blocking socket and want to connect to a machine which is reachable - on the other side the port does not exist. Why does select(...) succeed anyway? I expected a…
HelloWorld
  • 2,392
  • 3
  • 31
  • 68
8
votes
2 answers

Akka non blocking options when an HTTP response is requied

I understand how to make a message based non-blocking application in akka, and can easily mock up examples that perform concurrent operations and pass back the aggregated results in a message. Where I have difficulty is understanding what…
Eric
  • 127
  • 7
8
votes
2 answers

Is console output a blocking operation?

When a Java program calls System.out.println() or a Scala program calls println() does the thread block? I'm writing a Scala program with a huge amount of subtasks. Each subtask is executed inside a Future. It is recommended that code inside actors…
user573215
  • 4,679
  • 5
  • 22
  • 25
8
votes
1 answer

How does the UV_RUN_NOWAIT mode work in libuv?

When running an event loop in libuv using the uv_run function, there's a "mode" parameter that is used with the following values: UV_RUN_DEFAULT UV_RUN_ONCE UV_RUN_NOWAIT The first two are obvious. UV_RUN_DEFAULT runs the event loop until there are…
Alexis King
  • 43,109
  • 15
  • 131
  • 205