java - How to configure Netty to have a single worker thread? -


let's assume we're implementing service accesses shared data, , there no way of partitioning data portions can accessed independently. reason, not more 1 single thread can read/write data @ given time.

a correct, although inefficient way solve use synchronization technique (semaphores, monitors etc.), netty worker threads don't corrupt shared data accessing @ same time (when servicing requests). however, whole locking/unlocking degrade performance huge amount.

so, first question is:

how configure netty have single worker thread?

and second is:

what design solve problem of having shared data access cannot done more 1 thread @ given time?

the 1-worker solution seems solve problem, wonder how hurt netty's performance, since there might tens of thousands of clients connected @ same time, sending requests , waiting replies...

  1. give socketfactory single threaded executor, or
  2. put shared , executionhandler single threaded executor in pipeline

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -