blocking

If MessageBox()/related are synchronous, why doesn't my message loop freeze?

Why is it that if I call a seemingly synchronous Windows function like MessageBox() inside of my message loop, the loop itself doesn't freeze as if I called Sleep() (or a similar function) instead? To illustrate my point, take the following skeletal WndProc: int counter = 0; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, ...

using QTextStream to read stdin in a non-blocking fashion

Using Qt, I'm attempting to read the contents of the stdin stream in a non-blocking fashion. I'm using the QSocketNotifier to alert me when the socket has recieved some new data. The setup for the notifier looks like this: QSocketNotifier *pNot = new QSocketNotifier(STDIN_FILENO, QSocketNotifier::Read, this); connect(pNot, SIGNAL(activa...

Backup MySQL database

Hi, I have a MySQL Database of about 1.7GB. I usually back it up using mysqldump and this takes about 2 minutes. However, I would like to know the answers to the following questions: 1) Does mysqldump block read and/or write operations to the database? Because in a live scenario, I would not want to block users from using the database ...

How to prevent downloading images and video files from my website

it is possible ? what is the best way to do this ? ...

Block all urls on windows desktop using win32 API

Hello, I am trying to develop one application which can block all urls using win32 api on windows desktop application. So is there any api or any procedure doing programmatically so that i can block all urls? ...

Closing JFrame of java applet using buttons on the system frame causes delay

I have written a java applet which opens a JFrame (so when run in the browser, it will popup a small new window). The problem is, when pressing one of the buttons of the window frame, there is a slight delay (cannot move the mouse for 2 or 3 sec) before the window will close/minimize/maximize. The hidden menu actions (accessed when pres...

Can I limit blocking to individual loops within my SQL cursor

Hi Folks, I've some work to do on a largish database which basically requires calling a stored proc with different parameters for every value in a table (approx. 20k entries). I want to do this without blocking on that table or the other tables involved for each loop for the time it takes the whole process to run. Is is possible from wi...

Is there anything inherently wrong with using setTimeout to simulate a parallel action?

When the users of this app make changes to the fields a large amount of changes need to happen across other fields. Typically even with optimized scripts the browser will block user input for upwards of 1 second in IE. To stop with from occurring I do this: var i = 100; GetTextInputs().filter('[' + name + ']').each(function() { ...

Message loop gets blocked when application menu has the focus

Hi, I'm developing an application that looks mainly like this: while (true) { while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } DoSomething(); Sleep(1); } What I noticed is that DoSomething() doesn't get called when I click on the menu bar (displaying ...

C# - how to block for GUI or an event

Hi, I'm trying to create a very simple version of the game Simon with the WiiMote, using WPF. What I'm stuck on is how to make it turned-based, where the program blocks until the GUI is done displaying a sequence. Here's the code I have so far (mostly based on an answer here: http://stackoverflow.com/questions/1511870/wpf-sequential-an...

Perl: Blocking signal NOT delayed as it should be -> Test code provided.

In a Perl script I'm writing I'm having a problem where I block the INT and QUIT signals, execute a process within backticks, and then unblock the INT and QUIT signals. I want to prevent an INT or a QUIT from reaching the child process and killing it. The script successfully blocks and unblocks at the right points in the code, however...

Using multiple sockets, is non-blocking or blocking with select better?

Lets say I have a server program that can accept connections from 10 (or more) different clients. The clients send data at random which is received by the server, but it is certain that at least one client will be sending data every update. The server cannot wait for information to arrive because it has other processing to do. Aside f...

Javascript: How to delay loading external JS file (Google Analytics)?

I'm using the following code to load my Google Analytics (external javascript) in a way that is meant to not block rendering. However, using both YSlow and Safari Web Inspector - the network traffic clearly shows that the ga.js script is still blocking rending. /* http://lyncd.com/2009/03/better-google-analytics-javascript/ Inserts GA ...

Prevent .php file from being loaded outside jQuery request page

I have a page that is loaded within another page using jQuery. What I wanted to know is if it is possible to somehow block direct access to that page that gets loaded within another page. ...

SQL Server blocking on 'create function...', what does this imply?

Hi folks, I've used the sql from this article http://blogs.techrepublic.com.com/datacenter/?p=275 to try and track down the cause of a lot of blocking which has been going on recently within my sql server 2005 database. A number of times, all the processes returned are calling 'create function...', the functions vary but a number of the...

blocks - send input to python subprocess pipeline

I'm testing subprocesses pipelines with python. I'm aware that I can do what the programs below do in python directly, but that's not the point. I just want to test the pipeline so I know how to use it. My system is Linux Ubuntu 9.04 with default python 2.6. I started with this documentation example. from subprocess import Popen, PIPE...

Java ProcessBuilder: external process hangs

I'm using Java's ProcessBuilder class to run an external process. The process should not terminate before the Java program does; it must stay alive in command/response mode. I know that the process streams may easily 'jam' if neglected, so I've done the following: The program reads the process's combined output and error streams in a "r...

How to download files in a blocking/synchronous manner?

Hi, I am pretty new to silverlight and was very surprised to see that only asynchronous file downloading can be done. Well, I've attempted to counter act this by just setting a flag and waiting on it to change.. This is my simple code void MainPage_Loaded(object sender, RoutedEventArgs e) { WebClient webClient = new WebClient(); ...

How to organize ASP.NET request locking or row locking in DB

Hi! I've asp.net page/handler to access images. When performed fist request to the image I resize image to standard size(save on disk) and return it. So I need lock all request to the image except one. This one will resize image. Image identified by ID in URL, so I guess one lock object required per one image(ID in URL). My question is H...

ncurses and stdin blocking problem

I have stdin in a select() set and I want to take a string from stdin whenever the user types it and hits ENTER. But select is triggering stdin as ready to read before ENTER is hit, and, in rare cases, before anything is typed at all. This hangs my program on getstr() until I hit ENTER. I tried setting nocbreak() and it's perfect reall...