Questions tagged [blocking]

Blocking mode I/O blocks the issuing thread until the operation transfers at least one byte or an error or end of stream occurs. Blocking algorithms refer to an operation in multithreaded environment which temporarily restricts access to some resources to a single thread, thus blocking all other ones. It isn't clear which this tag is intended for.

1679 questions
8
votes
0 answers

"Best" ExecutionContext for IO

I have some synchronous calls in my Scala code. I've wrapped them in a blocking() context and then in a Future: Future(blocking(syncCall())), but I don't know which type of ExecutionContext to use. I know there may be a lot of possibilities and…
vicaba
  • 2,836
  • 1
  • 27
  • 45
8
votes
6 answers

Process.Start is blocking

I'm calling Process.Start, but it blocks the current thread. pInfo = new ProcessStartInfo("C:\\Windows\\notepad.exe"); // Start process mProcess = new Process(); mProcess.StartInfo = pInfo; if (mProcess.Start() == false) { …
Luca
  • 11,646
  • 11
  • 70
  • 125
8
votes
3 answers

Java Blocking List Implementation

I searched for an answer to this question on SO and Google but couldn't find a proper solution so far. I'm currently working on a LayerManager in a graph routing problem. The manager is responsible for providing and resetting a fixed set of layers.…
Daniel Gerber
  • 3,226
  • 3
  • 25
  • 32
8
votes
1 answer

Immidiate vs synchronous communication in openmpi

I got slightly mixed up regarding the concept of synchronous - asynchronous in the context of blocking & non blocking operations (in OpenMPI) from here: link 1 : MPI_Isend is not necessarily asynchronous ( so it can synchronous ?) link 2 :The…
Puneet S. Chauhan
  • 745
  • 1
  • 8
  • 17
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

Independent multithreaded processes block simultaneously

The system is Linux (Gentoo x64), the code is C++. I have a daemon application, several instances of which are run on the same machine. The application is multithreaded itself. For some time, I have been observing strange delays in its…
neoxic
  • 535
  • 3
  • 12
7
votes
2 answers

How do I block on reading a named pipe in Ruby?

I'm trying to set up a Ruby script that reads from a named pipe in a loop, blocking until input is available in the pipe. I have a process that periodically puts debugging events into a named pipe: # Open the logging pipe log = File.open("log_pipe",…
WaveformDelta
  • 141
  • 1
  • 8
7
votes
4 answers

Javascript - setTimeout Closure Issue

I'm struggling with the code below. I have tried many different ways of doing this but I end up with one of two incorrect results. for(i = 0; i < result.length; i++) { var tmpBlockInfo = { size: worldTest.data[0].size, …
james
  • 1,031
  • 1
  • 15
  • 31
7
votes
2 answers

Thread message loop for a thread with a hidden window?

I have a Delphi 6 application that has a thread dedicated to communicating with a foreign application that uses SendMessage() and WM_COPYDATA messages to interface with external programs. Therefore, I create a hidden window with AllocateHWND() to…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
7
votes
1 answer

Bluetooth On Android: my Socket.connect() Blocks forever, and Socket.close does not unblock

I have been working on a bluetooth app for android for awhile now and I just discovered this problem. When I preform mySocket.connect(); in my bluetooth service class it occasionally blocks indefinitely. I read the documentation for…
Joshua Abrams
  • 377
  • 1
  • 5
  • 17
7
votes
6 answers

BlackBerry: "Application is not responding; process terminated" because of UiApplication.getUiApplication().popScreen()?

I have a Blackberry application which, when run in some emulators with touch support (ex: 9500, 9520, 9530, 9550), terminates with: "Application is not responding; process XPTO terminated" Using logs, I found out that it seems like the application…
pandre
  • 6,685
  • 7
  • 42
  • 50
7
votes
2 answers

Process.Start is blocking/hanging randomly on some clients

(There is a very similar topic that never got solved: here) We have a big app running on several clients, but recently some of my code stopped working. Adding some debug code I found out the code stops at a call to Process.Start() (with no…
Wolf5
  • 16,600
  • 12
  • 59
  • 58
7
votes
3 answers

Read Python stdin from pipe, without blocking on empty input

I am trying to read stdin in a Python script, while receiving from pipe. I used these lines: for line in sys.stdin: print line And run the script: echo "test" | script.py So far it works fine. However if I don't use a pipe the program sticks at…
Ohad
  • 183
  • 3
  • 12
7
votes
4 answers

Remove blocking from a method

This is homework. I do not want the solution, just a small number of links or ideas. Simply speaking what I want to do is, Simple example : public class Example { public void method() { int x = doThat(); //Call other…
user418748
7
votes
4 answers

Is it OK to use `waitForReadyRead()` instead of creating a slot for `readyRead()` signal?

Writing a cross platform app using Qt (including Windows with MinGW). For reading data from SSL socket, I am creating a separate thread. This thread is there for historical reason, because earlier the app was written using C socket/ssl/crypto…
iammilind
  • 68,093
  • 33
  • 169
  • 336