nonblocking

Non-Blocking File IO in Java..

I want to write to a named pipe (already created) without blocking on the reader. My reader is another application that may go down. If the reader does go down, I want the writer application to neep writing to the named pipe. Something like a fopen(fPath, O_NONBLOCK) in Java. So that when the reader comes up, it may resume from where it ...

How to use select() in chat client program in C socket programming ?

I'm newbie. I want to make the client program to receive input from keyboard and data from server. I don't want if while user type something (scanf) and its block to receive data from server. How to write the code in C ? Thank you. ...

nonblocking socket recv problem while using it with epoll

hi there. i've got a problem: sometimes (not regularly) recv returns -1 and errno == EAGAIN while using epoll in edge-triggered mode. piece of code: server_sock = startup(&port); if ( (epollfd = epoll_create(4096)) < 0) { perror("epoll_create error"); exit(EXIT_FAILURE); } ev.events = EPOLLIN | EPOLLET; ev.data.fd = server_soc...

Explain rsync's --blocking-io option.

I have problems with understanding the --blocking-io option in rsync. Here's the descripton from the man page: "This tells rsync to use blocking I/O when launching a remote shell transport. If the remote shell is either rsh or remsh, rsync defaults to using blocking I/O, otherwise it defaults to using non-blocking I/O. (Note that ss...

Non-blocking IO with Ruby?

I have some questions about non-blocking IO: If I use Ruby without EventMachine on Nginx, could I leverage non-blocking IO? If i use Ruby with EventMachine but on Apache, could I leverage non-blocking IO? If the above answers are no, then it means I have to use Ruby with EventMachine on Nginx to leverage non-blocking IO? ...

Ruby on Rails + EventMachine?

I've heard that you have to use non-blocking code throughout the application to be able to harness true power of EventMachine. Does this mean I can't run Ruby on Rails with EventMachine? ...

Event loop is in the same thread as Node.js main?

So Node.js uses event loop for non-blocking IO. I wonder if that event loop is in the same thread as Node.js main for handling requests? ...

Sleep will stop Nginx since it's an event-based server?

I think if you have setTimeout=1 then the node server will be unavailable for all requests in 1 second since it's event-based, non-threaded web server (correct me if I'm wrong). I've heard that Nginx is also an event-based web server. Doesn't that mean that if I have sleep 1 then it would be halted for all requests in 1 second? ...

Node.js, process and threads question

Does process have at least one thread running? If so, then the Node.js will by default have 1 main thread and 1 event loop thread running? ...

non-blocking(event driven I/O) vs. blocking I/O

Recently I stumbled across this pretty slick JS library called nodeJS that acts like a server side JS. The main feature of the language being Evented I/O and which gives the inherent capacity of I/O being completely non-blocking!!! using callbacks. My question is if such kind of I/O mechanism which is completely non-blocking existed in...

Thread interrupt not ending blocking call on input stream read

I'm using RXTX to read data from a serial port. The reading is done within a thread spawned in the following manner: CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(port); CommPort comm = portIdentifier.open("Whatever", 2000); SerialPort serial = (SerialPort)comm; ...settings Thread t = new Thread(new SerialRea...

Jetty or Tomcat with Non-blocking IO (servlet 3.0)

I need a point to start from. I read from Yakov Fain about a performance break through with jetty and blazeds. I realized that we already have some trouble with about 1200 concurrent users, some consumers dont get messages and cpu is under heavy fire. Did somebody already tried this Nio with BlazeDS? Did this work with Tomcat too? Whe...

Non-blocking socket not observing OP_READ set - possible race condition?

So I've got a multithreaded server app using non-blocking sockets listening for connections. When a client connects, the client immediately sends a request and awaits a response. The server creates a new thread to handle the new connection, ensures that finishConnect is called and registers the new channel against the selector. Now, th...

Lock-free queue algorithm, repeated reads for consistency

I'm studying the lock-free (en-,de-)queue algorithms of Michael and Scott. The problem is I can't explain/understand (nor the paper does, apart from the comments in the code itself) a couple of lines. Enqueue: enqueue(Q: pointer to queue_t, value: data type) E1: node = new_node() // Allocate a new node from the free list ...

Non-blocking modal Swing progress dialog

A daft question, but I really cannot get this to work: I have some long-running process in a Swing application which may take several minutes. I want to display a progress dialog to the user while this process is ongoing. I also want to prevent the user from performing further actions, eg pressing a button while the process is going on. ...

Start simple web server and launch browser simultaneously in Python

I want to start a simple web server locally, then launch a browser with an url just served. This is something that I'd like to write, from wsgiref.simple_server import make_server import webbrowser srv = make_server(...) srv.blocking = False srv.serve_forever() webbrowser.open_new_tab(...) try: srv.blocking = True except KeyboardInte...

Non-blocking native files access - single-threaded daemon in C?

I've found out that native files access has no "non-blocking" state. (I'm correct?) I've been googling for daemons which are "non-blocking", and I've found one which achieved said behavior by threading file access operations, so that the daemon won't block. My question is, wouldn't threading and IPC'ing such operations be rather expens...

can i build c++ none blocking tcp server and not in C like (node.js.nginx)

Hi why each none blocking server is build with C ? cant i build it with c++ ? ...

Non-blocking class in python (detached Thread)

Hello everyone... I'm trying to create a kind of non-blocking class in python, but I'm not sure how. I'd like a class to be a thread itself, detached from the main thread so other threads can interact with it. In a little example: #!/usr/bin/python2.4 import threading import time class Sample(threading.Thread): def __init__(sel...

What threading module should I use to prevent disk IO from blocking network IO?

I have a Python application that, to be brief, receives data from a remote server, processes it, responds to the server, and occasionally saves the processed data to disk. The problem I've encountered is that there is a lot of data to write, and the save process can take upwards of half a minute. This is apparently a blocking operation, ...