Questions tagged [nonblocking]

Non-blocking mode I/O either transfers at least one byte or returns immediately with an error or end of stream. Non-blocking algorithms refer to use of concurrency without the usual mutual exclusion primitives, guaranteeing that thread operations will not block indefinitely. This is usually handled with atomic value modification (increment/decrement) and/or reading (compare-and-exchange) operations.. It isn't clear which this tag is intended for.

1597 questions
0
votes
1 answer

How to convert blocking file io to non-blocking in C

I am writing a code send the output of a terminal command over a socket in C. I have tried using select for asynchronous reading and avoid blocking the event-loop, but I wasn't successful. How can I change this code to make the file stream IO…
orezvani
  • 3,595
  • 8
  • 43
  • 57
0
votes
1 answer

Ruby IO#write_nonblock when to use?

It's simple for read_nonblock since the other end might not send anything yet and we will be blocked until some data is available. But I can't think of a case that write() is blocked. Can someone give me an example, sample code is highly…
w00d
  • 5,416
  • 12
  • 53
  • 85
0
votes
4 answers

Non Blocking recv() in C Sockets

I am using an infinite loop in sockets in which if it receives some data it should receive it or if it wants to send data it sends. Something like given below. I am using select. I have only one socket sd. fd_set readsd; int maxsd = readsd +1; //…
Natha Kamat
  • 71
  • 1
  • 5
  • 16
0
votes
2 answers

Non blocking connect call doesn't return connection refused

I have setup a timeout on a non-blocking connect call, which timesout correctly when the connection is attempted to an address that will not respond. However, when the connection is refused by the destination, it does not seem to return the…
donalmg
  • 627
  • 5
  • 15
  • 22
0
votes
1 answer

Java non-blocking IO: Is it possible to check how much you can write before calling channel.write()?

I understand a channel.write(outBuffer) can fail to write all the contents of outBuffer because the underlying socket buffer is full. Then you have to register OP_WRITE and wait for selector callbacks. However I don't want to write a partial message…
chrisapotek
  • 6,007
  • 14
  • 51
  • 85
0
votes
1 answer

Non Blocking Keyboard on WinCE accessing the virtual keyboard

I am desperately looking for a solution that enables me to read keyboard events in a non blocking way. These Keyboard events are generated by a VIRTUAL KEYBOARD that comes with the WinCE device. I have a console application running in C++, where the…
Jan H.
  • 1
0
votes
1 answer

generate statistics during pcap_loop every second

I am writing a PERL script, which captures packets, and then generate statistics in every second about all the TCP streams, which were online in that second. I am using NET::Pcap, and I want somehow to implement this, and if it's possible without…
molnarg
  • 445
  • 4
  • 8
0
votes
2 answers

how to use jquery load() as a non-blocking event?

i have this simple load request: $('#test').load('/sidebar/test/format/html').css("display","block"); the issue is that chrome is showing the request has 1.2 sec blooking. i'm thinking of using $.when: var test =…
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337
0
votes
1 answer

Losing bytes on an epoll controlled non-blocking socket when the other side writes and closes

I've a non-blocking socket currently subscribed to: ev.events = EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP| EPOLLET; It receives a couple of EPOLLINs which I read non-blocking till EAGAIN and then I receive HUP & RDHUP, sometimes with a…
Arkaitz Jimenez
  • 22,500
  • 11
  • 75
  • 105
0
votes
1 answer

Problem with O_NONBLOCK Pipe

I'm trying to send and receive using pipes: send.cpp struct { long a; long b; }T; cout << "1" << endl; if ( access ( FIFO_NAME, F_OK ) == -1 ) { res = mkfifo ( FIFO_NAME, 0755 ); if ( res != 0 ) …
Hosi
  • 545
  • 2
  • 7
  • 16
0
votes
1 answer

Using blocking IO in Play Framework 2.0.3

We are using a Play application that queries MySQL quite frequently. In fact, almost every operation queries the database in some way. As I understand it, Play is designed to support Async and non-blocking applications and encourages coding…
Ravish Bhagdev
  • 955
  • 1
  • 13
  • 27
0
votes
3 answers

How to use exitValue() with parameter?

A very good article (When Runtime.exec() won't) says: The only possible time you would use exitValue() instead of waitFor() would be when you don't want your program to block waiting on an external process that may never complete. Instead of using…
Ios mx
  • 85
  • 3
  • 10
0
votes
4 answers

Non Blocking Server in Python

Can someone please tell how to write a Non-Blocking server code using the socket library alone.Thanks
felix
  • 11,304
  • 13
  • 69
  • 95
0
votes
1 answer

Non-blocking transactions when reading from ActiveMQ queue with STOMP

I'm interacting with ActiveMQ via STOMP. I have one process which publishes messages and a multiple processes that subscribes and processes the messages (about 10 parallel instances). After reading a message I want to be sure that if, for some…
ygilad
  • 1
0
votes
2 answers

Arduino compiler throws "invalid type argument of unary *"

I am trying to program a nonblocking led-blink. Therefor i programed a little class: 03: class timer { 04: private: 05: int startMillis; 06: int delayMillis; 07: public: 08: timer ( int pDelay ) { 09: reset ( pDelay ); 10: } 11: …
steak
  • 2,117
  • 2
  • 13
  • 12
1 2 3
99
100