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
7
votes
2 answers

Using std::conditional_variable to wait on a condition

For simplicity, let's assume that we have only one conditional variable to match a single condition that is reflected by a boolean. 1) Why does std::condition_variable::wait(...) locks the mutex again after a "notify" has been sent to un-sleep…
Justin Bieber
  • 301
  • 1
  • 3
  • 8
7
votes
2 answers

Akka Model for computational tasks

I have the following requirement Connect to a webserver with a username and password and get an authetication token Read file to get different parameters Use the auth token fro step 1 and parameters from step 2 to send an http request to the web…
user_mda
  • 18,148
  • 27
  • 82
  • 145
7
votes
2 answers

How to run a jQuery function after all and any other javascript has run

I have a photo gallery page hosted on a CMS (Squarespace) which has some of it's own scripts which load the thumbnails asynchronously. The actual large images however are not preloaded, so I decided to add my own script into the mix to just make the…
andy
  • 8,775
  • 13
  • 77
  • 122
7
votes
3 answers

Non-blocking solution to the dining philosophers

I have been asked to write a simple solution to the dining philosophers problem in python. That itself seems quite straight forward but am some what confused since I am asked to write a non-blocking solution. I am unsure what is meant by this in…
Seb
  • 117
  • 1
  • 6
7
votes
2 answers

Java BufferedReader readline blocking?

I want to make an HTTP request and then get the response as sketched here: URLConnection c = new URL("http://foo.com").openConnection(); c.setDoOutput(true); /* write an http request here using a new OutputStreamWriter(c.getOutputStream)…
tgguy
  • 161
  • 1
  • 2
  • 3
7
votes
2 answers

Mysql SELECT FOR UPDATE - strange issue

I have a strange issue (at least for me :)) with the MySQL's locking facility. I have a table: create table `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 With…
Michał Fronczyk
  • 1,859
  • 4
  • 24
  • 29
7
votes
3 answers

How to find out what SQL queries are being blocked and what's blocking them?

I'm trying to optimize some slow web pages, and my guess is that the problem has to do with SQL blocking (doesn't seem to be a matter of CPU or I/O utilization on the web server or database server). What's the quickest way to find out what queries…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
7
votes
1 answer

Read a filestream (named pipe) with a timeout in Smalltalk

I posted this to the Squeak Beginners list too - I'll be sure to make sure any answers from there get here :) I'm using Squeak 4.2 and working on the smalltalk end of a named pipe connection, which sends a message to the named pipe server with: …
dsl101
  • 1,715
  • 16
  • 36
7
votes
3 answers

How to block an operation until a condition is met?

I am running this code and it is using a fair amount of CPU even though it is doing absolutely nothing most of the time. while (this.IsListening) { while (this.RecievedMessageBuffer.Count > 0) { lock (this.RecievedMessageBuffer) …
MJLaukala
  • 171
  • 1
  • 3
  • 13
6
votes
2 answers

Can a Node.js server accept incoming requests while the event queue is blocked?

So I'm just starting to dive into Node and I understand that the I/O is non-blocking and that the event loop is blocking but what I am wondering is: If you have code which is blocking the event queue, will the server still be able to place incoming…
Cory Danielson
  • 14,314
  • 3
  • 44
  • 51
6
votes
3 answers

blocking select() from multiple sockets

Unix/C question here. I have multiple sockets that I am trying to poll for periodic data. I don't want select to wait indefinitely so I have a timeout in place and I'm running in a loop. I have found that once a socket is ready to read, it is…
RootsAmongRuins
  • 101
  • 1
  • 7
6
votes
1 answer

Creating a custom blocking Java Swing prompt

This problem is solved. I'm am developing a Java Swing based projected, and the look & feel of the application is completely customized. We are trying to maintain a consistent appearance throughout the program, and the default Java dialog windows…
Reivax
  • 127
  • 2
  • 9
6
votes
3 answers

Block script in IE

I have a fancy script that is nice, but not essential and surprise surprise, doesn't play nice with IE. How do I 'comment it out' for IE? I know I can use the following to include statements for IE, but how do I exclude them?