nonblocking

How to do a non-waiting write on a named pipe (c#) ?

Hello, I'm using .net 3.5 named pipes and my server side is : serverPipeStream = new NamedPipeServerStream("myPipe", PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous); When I write some data with, say, BinaryWriter, the write() call itself doesn't return until the client side has called a read() on its Name...

Non-blocking TCP buffer issues.

Hi! I think I'm in a problem. I have two TCP apps connected to each other which use winsock I/O completion ports to send/receive data (non-blocking sockets). Everything works just fine until there's a data transfer burst. The sender starts sending incorrect/malformed data. I allocate the buffers I'm sending on the stack, and if I unde...

how do twisted/tornado et cetera work

I understand that they work in some way distinct from making a thread per user. How exactly does that work? (Does 'non-blocking' have something to do with it?) ...

how does a non-blocking event loop work?

Twisted has a "non-blocking" event loop. I understand what a blocking event loop does (sort of, from the Wikipedia page) but can't figure out how a non-blocking one does. ...

Ruby 1.8 and disk I/O in a multi-threaded setting

Ruby 1.8 uses userspace threads, not operating system threads. This means that Ruby 1.8 can only utilize a single CPU core no matter how many Ruby threads you create. On the bright side, not all is bad. Ruby 1.8 internally uses non-blocking I/O while Ruby 1.9 unlocks the global interpreter lock while doing I/O. So if one Ruby thr...

How can I run a program in the background (non blocking) with php?

Hi, I want to run a shell script in php, but this shell script takes a long time to execute (it has sleep in it), I don't want the web server to block when executing this script. I tried exec() and shell_exec() in php but the server stops until the shell script finishes! I thought of doing fork in the shell script itself but I don't kn...

Java non-blocking IO selector causing channel register to block.

I have two threads that I'm dealing with Java NIO for non-blocking sockets. This is what the threads are doing: Thread 1: A loop that calls on the select() method of a selector. If any keys are available, they are processed accordingly. Thread 2: Occasionally registers a SocketChannel to the selector by calling register(). The proble...

How can be implemented non-blocking disk I/O?

I'm interested in file and raw. ...

Incremental Stream Parsing in C++

Hi, I am reading data from a (serial) port using a non-blocking read() function (in C/C++). This means the data comes-in in chunks of undetermined (but reported) sizes (incl. 0) each time I "poll" the port. I then need to parse this "stream" for certain patterns (not XML). My naive implementation concatenates the new string to the pre...

Selector.select(timeout) x Selector.selectNow()

Hi, I'm implementing a Non-Blocking HTTP server in Java and decided to use pure Java NIO. I'm combining a NIO Selector with a small thread pool to perform the operations indicated by the selector. Leaving the system choose the default selector (tested in Linux 2.6 epoll and Mac OS Snow Leo KQueue) and using Selector.select(TIMEOUT); I ...

How to make Rails Nonblocking?

I have a rails application that occasionally needs to do very slow network calls (that might not ever return) based on a web user hitting a route. If the call is slower than normal (or doesn't return), Rails seems to block, not allowing ANYTHING else to happen (I can't open up another browser and hit a different route, I can't use a dif...

Janrain RPXnow (Engage) (https://rpxnow.com/) bypasses popup-blockers... how?

Basically I need to open a login window in a popup, so that it doesn't get blocked by popup blocker. Similar to what Janrain does in it's RPXnow solution. How do they do that? ...

Python Popen: are the pipes in blocking mode? how can I put them in non-blocking mode?

Hi, In the subprocess documentation, I haven't found any hint if the pipes created by PIPE are blocking or non-blocking. I.e., if I call p.stdout.read(), will it block in certain circumstances? The documentation warns about that. How can I avoid that? Using p.communicate() is not an option for me because I don't want to block/wait unt...

Non-blocking concurrent collection?

System.Collections.Concurrent has some new collections that work very well in multithreaded environments. However, they are a bit limited. Either they block until an item becomes available, or they return default(T) (TryXXX methods). I'm needing a collection that is thread safe, but instead of blocking the calling thread it uses a c...

C fork/exec with non-blocking pipe IO

This seems to be a fairly common thing to do, and I've managed to teach myself everything that I need to make it work, except that I now have a single problem, which is defying my troubleshooting. int nonBlockingPOpen(char *const argv[]){ int inpipe; pid_t pid; /* open both ends of pipe nonblockingly */ pid = fork(); ...

python - multiprocessing queue put nowait blocking question

hi.. got a test function, used by a worker process. the nextqueue has been set to have a size of 1, for a single element.. foo1 can be invoked mutiple times on the 1st time through, the queue gets set correctly all other times.. it appears that the function blacks/gets stuck on the put_nowait the queue is created by importing the m...

Non-blocking Queues

IBM (see Source) wrote on the benefits of Java's 1.5 java.util.concurrent class, which offers non-blocking queues. Please explain the weaknesses/disadvantages of the NonBlockingCounter below. public class NonblockingCounter { private AtomicInteger value; public int getValue() { return value.get(); } public int...

TNonblockingServer, TThreadedServer and TThreadPoolServer, which one fits best for my case?

Our analytic server is written in c++. It basically queries underlying storage engine and returns a fairly big structured data via thrift. A typical requests will take about 0.05 to 0.6 seconds to finish depends on the request size. I noticed that there are a few options in terms of which Thrift server we can use in the c++ code, speci...

How to make sure a dialog is always front of the main window.

I have not yet found the best solution for this. I have a non modal dialog that can be opened in unlimited instances by a hotkey in the application. Even the dialog itself can open a new instance. I want those dialogs to always be front of the main application window. I have tried a couple of things. Set FormStyle to fsStayOntop. This ...

I wonder is there a better way to implement this "simple lock"

Is there a better way to do implement a simple lock like below? I only want to to the "DOSOMETHING" if it's not already being run. Should I be using reall locks here? if I use lock will that cause everything to queue up and wait for the lock to release? (that's not what I want!) Thanks bool running = false; void DataDisplayVi...