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
11
votes
3 answers
non-blocking udp socket programming in C: what do I get?
I have a problem in understanding what recv()/recvfrom() return from an non-blockig UDP socket.
A bit more specific and compared to TCP (please correct me if I'm wrong):
A blocking socket (either TCP or UDP) won't return from a recv() until there…

Uwe
- 113
- 1
- 1
- 5
11
votes
2 answers
Why new thread instead of future {...}
This answer instructs how to convert java.util.concurrent.Future into scala.concurrent.Future, while managing where the blocking will occur:
import java.util.concurrent.{Future => JFuture}
import scala.concurrent.{Future => SFuture}
val jfuture:…

Dominykas Mostauskis
- 7,797
- 3
- 48
- 67
11
votes
4 answers
read and write to same socket (TCP) using select
We're writing a client and a server to do (what I thought was) pretty simple network communications. Mulitple clients connect to the server which then is supposed to send the data back to all other clients.
The server just sits in a blocking select…

MarcWan
- 2,943
- 3
- 28
- 41
11
votes
2 answers
Query a PHP semaphore without blocking?
Is it possible to query a semaphore created with sem_get without actually blocking like the sem_acquire function does?
Cheers,
Dan.

Dan
- 5,692
- 3
- 35
- 66
11
votes
1 answer
jQuery UI modal dialog not blocking
I am new to javascript and jQuery. I am trying to implement a modal dialog using jQuery UI widgets.
The modal dialog shows up correctly with OK and Cancel buttons, but the dialog('open') function call does not seem to block and wait for an OK or…

Soundar Rajan
- 517
- 2
- 7
- 17
11
votes
4 answers
Is it bad practice to just kick off new threads for blocking operations (Perl)
If doing CPU intensive tasks I believe it is optimal to have one thread per core. If you have a 4 core CPU you can run 4 instances of a CPU intensive subroutine without any penalty. For example I once experimentally ran four instances of a CPU…

john doe
- 403
- 2
- 11
11
votes
1 answer
Why doesn't this call to `poll` block correctly on a sysfs device attribute file?
I have a simple sysfs device attribute which shows up under my sysfs directory, and on a call to read returns the value of a kernelspace variable. I want to call poll on this attribute to allow my userspace thread to block until the value shown by…

Vilhelm Gray
- 11,516
- 10
- 61
- 114
11
votes
3 answers
SQL Server ALTER field NOT NULL takes forever
I want to alter a field from a table which has about 4 million records. I ensured that all of these fields values are NOT NULL and want to ALTER this field to NOT NULL
ALTER TABLE dbo.MyTable
ALTER COLUMN myColumn int NOT NULL
... seems to take…

Chris Klepeis
- 9,783
- 16
- 83
- 149
10
votes
5 answers
Google Analytics - Blocks HTML/page rendering
I have used the "Better Google Analytics JavaScript that doesn’t block page downloading" to load Google Analytics dynamically so that it will not block HTML / page rendering.
However, it appears occassionaly that my HTML page will block rendering on…
BenHelley
10
votes
2 answers
Best method to "block" until certain condition is met
I would like to create some method to be used in a generic way, were it would block (unless a certain timeout expires) until a given condition is met.
The usage in code would be something similar to:
WaitUntil( condition );
I have tried…

lysergic-acid
- 19,570
- 21
- 109
- 218
10
votes
1 answer
Possible to stop cin from waiting input?
In a graphical application I execute debug commands using the console input. When the console is created a new thread is also created to gather the user commands that handles all that input, the graphical application continues running parallel. I…

notNullGothik
- 432
- 5
- 20
10
votes
3 answers
Synchronisation object to ensure all tasks are completed
Which Java synchronisation object should I use to ensure an arbitrarily large number of tasks are completed? The constraints are that:
Each task takes a non-trivial amount of time to complete and it is appropriate to perform tasks in…

Carlos Macasaet
- 1,176
- 7
- 23
10
votes
3 answers
Wait for Task to Complete without Blocking UI Thread
I have a fairly complex WPF application that (much like VS2013) has IDocuments and ITools docked within the main shell of the application. One of these Tools needs to be shutdown safely when the main Window is closed to avoid getting into a "bad"…

MoonKnight
- 23,214
- 40
- 145
- 277
10
votes
1 answer
How can I reliably clean up Rust threads performing blocking IO?
It seems to be a common idiom in Rust to spawn off a thread for blocking IO so you can use non-blocking channels:
use std::sync::mpsc::channel;
use std::thread;
use std::net::TcpListener;
fn main() {
let (accept_tx, accept_rx) = channel();
…

sleeparrow
- 1,242
- 13
- 22
10
votes
2 answers
SQL Server LCK_M_S only happens in production
I have a stored procedure that is called by a SQL Server 2012 report that is taking an age to run in production compared to development because of a blocking session lck_m_s
The stored procedure runs instantaneously when executed in SQL Server…

best
- 285
- 1
- 5
- 9