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.
Questions tagged [blocking]
1679 questions
21
votes
3 answers
Fastest way to insert in parallel to a single table
My company is cursed by a symbiotic partnership turned parasitic. To get our data from the parasite, we have to use a painfully slow odbc connection. I did notice recently though that I can get more throughput by running queries in parallel (even…

Brandon Moore
- 8,590
- 15
- 65
- 120
20
votes
5 answers
How to call an asynchronous JavaScript function and block the original caller
I have an interesting situation that my usually clever mind hasn't been able to come up with a solution for :) Here's the situation...
I have a class that has a get() method... this method is called to get stored user preferences... what it does is…

Frank W. Zammetti
- 1,231
- 1
- 11
- 19
20
votes
1 answer
Twisted: Making code non-blocking
I'm a bit puzzled about how to write asynchronous code in python/twisted. Suppose (for arguments sake) I am exposing a function to the world that will take a number and return True/False if it is prime/non-prime, so it looks vaguely like this:
def…

acrophobia
- 924
- 7
- 22
20
votes
2 answers
pygame multithread client socket GUI Blocking
I want to write a gomoku game with server and client. The terminal version works well, but pygame version just blocked and can't rend anything.
Here is the game execute function
First it start a socket connection
self._running = True in init,…

Aries_is_there
- 386
- 2
- 13
20
votes
1 answer
Java blocking issue: Why would JVM block threads in many different classes/methods?
Update: This looks like a memory issue. A 3.8 Gb Hprof file indicated that the JVM was dumping-its-heap when this "blocking" occurred. Our operations team saw that the site wasn't responding, took a stack trace, then shut down the instance. I…

user331465
- 2,984
- 13
- 47
- 77
20
votes
5 answers
Non-blocking sockets
What's the best way to implement a non-blocking socket in Java?
Or is there such a thing? I have a program that communicates with a server through socket but I don't want the socket call to block/cause delay if there is a problem with the…

jasonline
- 8,646
- 19
- 59
- 80
20
votes
4 answers
Multiple receivers on a single channel. Who gets the data?
Unbuffered channels block receivers until data is available on the channel. It's not clear to me how this blocking behaves with multiple receivers on the same channel (say when using goroutines). I am sure they would all block as long as there is no…

Leo Houer
- 347
- 2
- 4
- 8
20
votes
1 answer
Will an AFTER trigger in Postgres block an insert/update?
If I set up an AFTER trigger in PostgreSQL to fire after an insert/update, will the calling software have to wait for the trigger to finish before returning control to the calling software? Or will the trigger run on its own behind the scenes?

iandouglas
- 4,146
- 2
- 33
- 33
19
votes
4 answers
Non-blocking socket with poll
A couple of days ago I had to investigate a problem where my application was showing abnormally high CPU usage when it was (apparently) in idle state. I tracked the problem down to a loop which was meant to block on a recvfrom call while the socket…

341008
- 9,862
- 11
- 52
- 84
19
votes
6 answers
SQL Server SELECT statements causing blocking
We're using a SQL Server 2005 database (no row versioning) with a huge select statement, and we're seeing it block other statements from running (seen using sp_who2). I didn't realise SELECT statements could cause blocking - is there anything I can…

Neil Barnwell
- 41,080
- 29
- 148
- 220
19
votes
2 answers
Running a WPF control in another thread
I am using a visual control in my project that is from a library that I do not have the source to.
It takes too long to update (200ms, roughly) for good UI responsiveness with three of these controls on-screen at once. (I might need to update all…

DefenestrationDay
- 3,712
- 2
- 33
- 61
18
votes
6 answers
Lua - get command line input from user?
In my lua program, i want to stop and ask user for confirmation before proceeding with an operation. I'm not sure how to stop and wait for user input, how can it be done?

RCIX
- 38,647
- 50
- 150
- 207
17
votes
3 answers
Celery worker hangs without any error
I have a production setup for running celery workers for making a POST / GET request to remote service and storing result, It is handling load around 20k tasks per 15 min.
The problem is that the workers go numb for no reason, no errors, no…

Maddy
- 791
- 1
- 8
- 22
17
votes
3 answers
python subprocess communicate() block
I am using the subprocess module to call an external program (plink.exe) to log-in to a server; but when I call communicate to read the output, it is blocking. The code is below:
import subprocess
process = subprocess.Popen('plink.exe…

Mingo
- 1,613
- 2
- 16
- 20
17
votes
7 answers
C++ - how does Sleep() and cin work?
Just curious. How does actually the function Sleep() work (declared in windows.h)? Maybe not just that implementation, but anyone. With that I mean - how is it implemented? How can it make the code "stop" for a specific time? Also curious about how…

quano
- 18,812
- 25
- 97
- 108