blocking

[c++winsock2.0]How to abort winsock blocking call ?

I use Winsock 2 in C++, and wonder how to make my server stop reading from the client connection. The reading thread gets blocked in recv() and I have no idea how to abort it. One way to do this is use non-blocking sockets with select(), but this thread has to wait before checking the new select(). What is the proper way to stop readin...

How to prevent JavaScript HTML blocking

How do I prevent JavaScript from blocking other JavaScript's from starting to download? I have the following on my web site: <html> <body> .... <script type="text/javascript" src="http://example.com/ex.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://google.com/google-maps.js"&gt;&lt;/script&gt; </body> </html> When ...

SQL Server requests time out as TempGetStateItemExclusive is getting called continuously

I run a site with decent traffic (~100,000 page views per day) and sporadically the site has been brought to its knees due to SQL Server timeout errors. When I run SQL Profiler, I see a command getting called hundreds of times a second like this: ... exec dbo.TempGetStateItemExclusive3 @id=N'ilooyuja4bnzodienj3idpni4ed2081b',... ... ...

Java thread interrupts and joins (thread is still alive after join)

Hi all, trying to figure out some behavior. I've got some code that spawns one thread. It waits some amount of time, and then interrupts it, joins it and then exits the method. . . . try { Thread.sleep(processForMillis); } catch (InterruptedException ex) { // Won't happen, ignore. } for (Thread t : thre...

java: wrapping an asynchronous computation into a synchronous (blocking) computation

similar questions: Pattern for wrapping an Asynchronous JavaScript function to make it synchronous Wrapping an asynchronous method synchronously in C# I have an object with a method I would like to expose to library clients (especially scripting clients) as something like: interface MyNiceInterface { public Baz doSomethingAndBlo...

C# : Blocking a function call until condition met.

I am developing a C# Winforms application, part of the application will be uploading files to a webserver using AsyncUpload (using it,due to the need to use a porgress callback) , In the C# program i got a simple for loop that calls The Uploading function for(int i=0;i < 10 ; i++) { Uploadfun(); } And the fun does some magic: Up...

How can I make a program wait for a button press in javascript?

I need to modify some legacy javascript code. There's a place where I want to wait until the user presses one of two buttons and then continue with the program flow (like prompt() function). How can this be achieved ? ...

AutoResetEvent object , waits 60 secs OR event

Im using AutoResetEvent object to block a thread for 60 secs ,, but I would like to block it for 60 secs or AutoResetEvent.set() event CODE : global: private readonly AutoResetEvent _signal = new AutoResetEvent(false); blocking: _signal.WaitOne(60000, true); event to give signal _signal.Set(); but it alwayas waits the whole 60 se...

C: non-blocking udp socket: what do I get?

Hi there, 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 is some data in the buffer. This could be some number of bytes (TCP) or a comp...

How to create a fixed blocked (FB) file for IBM mainframe/FTP in VBA

I've got VBA code that generates a text file with some pretty basic information included. I then upload that file via FTP. I got a message from the server admin of the IBM mainframe today that my file was in variable blocking (VB) format and their job process uses a fixed blocking (FB) up to a max size of 256. How is this done? Durin...

Blocking event subscription in compile time.

Related to my previous question. Is there a way to block the subscription in compile time? Something like marking the event's "Add" as "private" in the implementor even though it's public in the interface. ...

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 are getting blocked and what queries are doing the blocking? ...

A Packet Blocker Software

Can any one suggest me a packet blocking software ?? My requirement is to block packets within the LAN.(Internet does not come into picture). Supposing CLIENT_A communicating to CLIENT_B in the same network(LAN). I want a CLIENT_C (who is in the same network) to capture(I can use jpcap library's sniffer for this purpose) and block pac...

Integration testing: Start a blocking server during `unittest.setUp` before testing it?

I'm writing a service using Thrift and need to apply some tests to ensure that it operates/responds as expected. To accomplish this, the most robust approach seems to be to use the unittest module. I'd like to start the service in "test" mode (starts on a specific "test" port, uses "test" data, etc) from directly within the unit test's...

python blocking sockets, send returns immediately

Hi, I am writing a multithreaded socket application in Python using the socket module. the server listens for connections and when it gets one it spawns a thread for that socket. the server thread sends some data to the client. but the client is not yet ready to receive it. I thought this would have caused the server to wait until the ...

Named pipe blocking with user nobody

I have 2 short scripts. The first, an awk script, processes a large file and prints to a named pipe 'myfifo.dat'. The second, a Perl script, runs a LOAD DATA LOCAL INFILE 'myfifo.dat'... command. Both of these scripts work when run locally like so: lee.awk big.file & lee.pl However, when I call these scripts from a PHP webpage, the n...

What is meaning of 'Blocking' in Firebug Net Panel?

I'm using Firebug 1.5.2 and while testing a site before production release i can see a huge amount of time consumed by 'Blocking' parts of the requests. What exactly does the 'Blocking' mean? ...

WCF Blocking problem with mutiple clients!!

Hi I seem to have a blocking issue with WCF. Say I have two users and each have created their own instance of a class exposed on a WCF host using net.tcp with endpoint something like this "net.tcp://localhost:32000/SymHost/". The class is PerSession context and concurrency is reentrant. The class exposes two methods Alive() which retu...

Mysql SELECT FOR UPDATE - strange issue

Hi, I have a strange issue (at least for me :)) with the MySQL's locking facility. I have a table: Create Table: CREATE TABLE test ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 With this data: +----+ | id | +----+ | 3 | | 4 | | 5 | | 6...

Mixing NIO with IO

Hi Usually you have a single bound tcp port and several connections on these. At least there are usually more connections as bound ports. My case is different: I want to bind a lot of ports and usually have no (or at least very few) connections. So I want to use NIO to accept the incoming connections. However, I need to pass the accep...