bpd1069 / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

nacl-mounts: replace HTTP2Mount global lock with HTTP2Node lock #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently HTTP2Mount uses a global lock in HTTP2Mount::Read() which blocks any 
other node from working concurrently.

In my application this causes a big problem: I've created another thread to 
download data in background that user will need later (prefetching). 
Unfortunately when this background thread runs, the main thread will block as 
soon as it try doing a simple read() operation.

The proposed patch fixes this by moving the lock into HTTP2Node. The HTTP2Mount 
lock still exists, but it is only used to protect structures like slots_. The 
other class members are set on initialization and then used only for reading, 
except for MainThreadRunner *runner_ which is already thread-safe.

Original issue reported on code.google.com by mfrei...@gmail.com on 6 Jul 2012 at 3:38

Attachments:

GoogleCodeExporter commented 9 years ago
nacl-mounts is basically dead.  Any new development should happen in nacl_io.

Original comment by sbc@google.com on 13 Jun 2013 at 10:37