FAQ Database Discussion Community


WinSock C++ Console App Instant Messanger recv doesn't block

c++,sockets,networking,blocking
I have a question regarding WinSock library. I'm trying to write simple instant messages program. I wrote it only for 2 clients, and now i would like to improve it, so It can work for many of them, and each client would sent an message with its number and number...

Autohotkey check for Ctrl pressed error

keypress,autohotkey,blocking
I've only recently gotten back into using AHK after taking a break from it for a few years, so forgive me if there's a very easy answer for this. I'm writing a script which tracks keypresses while control is held down, and then allows one of 9 hotkeys to be...

Is select() + non-blocking write() possible on a blocking pipe or socket?

sockets,unix,pipe,posix,blocking
The situation is that I have a blocking pipe or socket fd to which I want to write() without blocking, so I do a select() first, but that still doesn't guarantee that write() will not block. Here is the data I have gathered. Even if select() indicates that writing is...

subprocess.call is not waiting

python,blocking
with open('pf_d.txt', 'w+') as outputfile: rc = subprocess.call([pf, 'disable'], shell=True, stdout=outputfile, stderr=outputfile) print outputfile.readlines() output.readlines() is returning [] even though the file is written with some data. Something is wrong here. looks like subprocess.call() is not blocking and the file is being written after the read function. How do i...

KeyEvent keyPressed key combination is blocked

java,blocking,keyevent,blocked
I've been struggling with the following problem for quite some hours now and can't find the solution. I'm currently working on a music/rhythm game, in which the user has to press certain keys at the right time to score points. Now, since it's supposed to be similar to playing piano,...

blocking listen prevents disconnect

c#,multithreading,blocking,irc
Overview of Problem: I need to connect to an IRC Server. Once connected, the program will send a message to the channel, and a response will occur over multiple lines back. I need to read these lines and store in a variable for later use. A special character at the...

Non-blocking and blocking assignments don't work as expected

concurrency,verilog,simulation,blocking,assign
I'm having problems with understanding such a simply looking thing: blocking and non-blocking assignments. I created a small test bench just to simulate the behavior of this code: module ATest(clk, out); input wire clk; output reg [7:0] out; reg [7:0] A; initial begin A <= 8'b0; end always @(posedge clk)...

cancel a blocking operation in Go

go,timeout,blocking,goroutine
I have a blocking operation in a 3rd party library that I don't control. It could potentially go forever. So I want to set a timeout on it. The obvious way is to wrap it with a channel and a goroutine and then select on the result with time.After. However,...

when would a blocking socket.send() block? (UDP)

sockets,udp,send,blocking
I have been reading about UDP sockets in python. By default a socket is configured so that sending or receiving data blocks, stopping program execution until the socket is ready. Calls to send() wait for buffer space to be available for the outgoing data, and calls to recv() wait for...

Bulkheading strategies for Akka actors

java,asynchronous,akka,blocking,future
I have a scenario where an important actor needs to make a call to a slow (15 - 20 seconds) remote system: // Non-actor code equivalent public Result makeSlowNetworkCall(Request request) { Result result = slowServiceClient.soooooSlow(request); // Could be up to 15 - 20 SECONDS (mehhhh) return result; } The Akka...

C : non blocking sockets with timeout : how to check if connection request was made?

c,sockets,timeout,blocking
I would like to have a server that connects to one client at a time, ignoring connection request when connected to a given client. I would also liked to avoid the server to get locked when listening for the first client, so that the program can be terminated cleanly. Apparently,...

Non-blocking solution to the dining philosophers

python,algorithm,blocking,dining-philosopher
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 this context. Is anyone able...

ZMQ pair (for signaling) is blocking because of bad connection

python,zeromq,blocking,pyzmq
I have two threads. One is a Worker Thread, the other a Communication Thread. The Worker Thread is reading data off a serial port, doing some processing, and then enqueueing the results to be sent to a server. The Communication Tthread is reading the results off the queue, and sending...

Performance comparison between compare-and-swap and blocking algorithm

java,concurrency,blocking,lock-free
I have a ConcurrentLinkedQueue that I use as the underlying datastructure. On every put call, I add a unique incremented value to the list. I have both the synchronized and compare-and-swap versions of this method. When I have few threads (e.g., 5) and doing 10 million puts in all, I...

Find external process using databse on particular time and day every month

sql,blocking
On last Sunday of the last 2 months at 9.47AM we are getting blocking in SQL server. It last 2-3 hours and then disappears on its own. We don't get any blocking at all any other times of the month. How can I check what is happening at that particular...