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
8
votes
1 answer

Async read from Poco HTTPClientSession

the usual sample code for using HTTPClientSession goes something like this: Poco::Net::HTTPClientSession session(uri.getHost(), uri.getPort()); std::ostream& ostr = session.sendRequest(req); // Receive the response. Poco::Net::HTTPResponse…
Aviad Rozenhek
  • 2,259
  • 3
  • 21
  • 42
8
votes
3 answers

Non-blocking access to the file system

When writing a non-blocking program (handling multiple sockets) which at a certain point needs to open files using open(2), stat(2) files or open directories using opendir(2), how can I ensure that the system calls do not block? To me it seems that…
watain
  • 4,838
  • 4
  • 34
  • 35
8
votes
1 answer

NSMenu animations block main thread

I have: NSStatusItem with a custom view (scrolling text in a secondary thread), with the secondary thread updating the internal state and notifying the main thread with setNeedsDisplay. On mouseDown, an NSMenu pops up. However, if any NSMenuItem in…
tentonwire
  • 81
  • 1
8
votes
1 answer

Non-blocking SSL server using Thrift

Thrift provides several different non-blocking server models, like TNonblockingServer, THsHaServer, and TThreadedSelectorServer. But, I'd like to enable SSL on the server. It seems SSL only works on blocking servers in Thrift. Anyone has any clues…
ruichuan
  • 141
  • 1
  • 3
8
votes
4 answers

How are "nonblocking" data structures possible?

I'm having trouble understanding how any data structure can be "nonblocking". Say you're making a "nonblocking" hashtable. At some point or another, your hashtable gets too full, so you have to re-hash into a larger table. This implies you need to…
user541686
  • 205,094
  • 128
  • 528
  • 886
8
votes
3 answers

Launch non-blocking process from powershell

I'm writing a powershell script that needs to push code to several git repositories simultaneously? Here's the script I have thus far: param( [parameter(Mandatory=$true)] [string]$repoPath, [parameter(Mandatory=$true)] …
Micah
  • 111,873
  • 86
  • 233
  • 325
7
votes
2 answers

Making a non blocking HTTP request in a Rails app

Is anyone aware of a way to make outgoing non blocking HTTP requests from within Rails? I will need the response body eventually and am trying to avoid bringing up new frameworks to keep things simple. Thanks
beanserver
  • 652
  • 3
  • 6
7
votes
2 answers

Opengl Unsynchronized/Non-blocking Map

I just found the following OpenGL specification for ARB_map_buffer_range. I'm wondering if it is possible to do non-blocking map calls using this extension? Currently in my application im rendering to an FBO which I then map to a host PBO…
ronag
  • 49,529
  • 25
  • 126
  • 221
7
votes
2 answers

Using libcurl with libevent

Can anyone show (through code) or explain to me how I might use libevent and curl together in a c program? I'm trying to write a high-performance non-blocking data monitor which needs to upload data to a CouchDB instance. I'm familiar with both…
Peter Downs
  • 482
  • 1
  • 4
  • 14
7
votes
2 answers

In a non blocking socket connect, select() always returns 1

I have this code segment that is designed to connect to a server using a socket connection. However if it can not connect to the server within a certain amount of time I would like it to stop trying. I tried to do this with this nonblocking socket…
Daniel
  • 541
  • 2
  • 5
  • 16
7
votes
3 answers

Read Python stdin from pipe, without blocking on empty input

I am trying to read stdin in a Python script, while receiving from pipe. I used these lines: for line in sys.stdin: print line And run the script: echo "test" | script.py So far it works fine. However if I don't use a pipe the program sticks at…
Ohad
  • 183
  • 3
  • 12
7
votes
5 answers

How to create a Java non-blocking InputStream from a HttpsURLConnection?

Basically, I have a URL that streams xml updates from a chat room when new messages are posted. I'd like to turn that URL into an InputStream and continue reading from it as long as the connection is maintained and as long as I haven't sent a…
Warkior
  • 155
  • 1
  • 3
  • 9
7
votes
2 answers

java CompletableFuture.thenCombine returns CompletableFuture of CompletableFuture

I have 3 different methods in my application. All are returning CompletableFuture. I want to execute method 1 and 2 in parallel. On completion of method 1 and 2, I want to trigger method 3 with parameters from method 1 and 2 return…
7
votes
3 answers

How to handle exception in DeferredResult in Spring Boot?

I have a rest method: @RequestMapping(value = "wash/washHistory", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public DeferredResult getWashHistory(@RequestParam(value = "sid", required =…
Almas Abdrazak
  • 3,209
  • 5
  • 36
  • 80
7
votes
1 answer

Nonblocking Scrapy pipeline to database

I have a web scraper in Scrapy that gets data items. I want to asynchronously insert them into a database as well. For example, I have a transaction that inserts some items into my db using SQLAlchemy Core: def process_item(self, item, spider): …
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80