Commit Graph

86 Commits

Author SHA1 Message Date
Norman Maurer
62ebe88981 Allow to set IoRatio to 100% 2014-02-12 15:22:39 +01:00
Norman Maurer
80ed147652 [#2164] Only reregister SelectionKeys that are still valid 2014-01-29 07:18:29 +01:00
Trustin Lee
c9b7f1f1b5 Ensure the selector implementation can be instrumented before attempting instrumentation
- Fixes #1908
2013-10-11 12:08:51 +09:00
Norman Maurer
f034f90fb3 [#1836] Add comment to explain why read is triggered 2013-09-17 06:58:47 +02:00
Norman Maurer
80d30c3dd8 Small code improvements 2013-08-26 07:52:47 +02:00
Norman Maurer
4d0621855a Remove unused package private method and so remove some complexity 2013-08-09 11:44:41 +02:00
Norman Maurer
2871079c4a [#1557] Make the contract of Channel.Unsafe.flush() more clear
* Remove boolean parameter from Channel.Unsafe.flush() method
* Move NIO related things to AbstractNioChannel.NioUnsafe
2013-07-12 19:45:31 +02:00
Trustin Lee
99716993f6 Add a boolean parameter to Channel.Unsafe.flush() so that SelectionKey state check can be bypassed. 2013-07-12 20:14:50 +09:00
Trustin Lee
e10e9d38c4 Fix embarassing compilation error :-/ 2013-07-12 20:12:18 +09:00
Norman Maurer
2bda1b530a [#1523] Fix bug which lead to have SelectedKeys handled two times and so caused a NPE on heavy load 2013-07-04 16:15:33 +02:00
Trustin Lee
4b11aff08f Less confusing log messages for system properties
- Fixes #1502
2013-07-02 09:23:29 +09:00
Trustin Lee
3ce9ab2e72 Replace the sun.nio.ch.SelectorImpl.selectedKeys with faster one
- Yield much less garbage
- Slight performance gain (1~2%)
2013-06-11 00:00:55 +09:00
Norman Maurer
f7931af704 Re-add Unsafe.voidPromise() which can be used for Unsafe operations for which no notification should be done [#1375] 2013-05-25 14:35:22 +02:00
Norman Maurer
699ef0784e [#1317] Allow to use VoidPromise for flush(...), write(...) and sendFile(...)
* This also move rename Channel.Unsafe.voidFuture() to ChannelPropertyAccess.voidPromise()
2013-05-17 15:50:14 +02:00
Trustin Lee
23d0178494 Introduce EventExecutor.shutdownGracefully() that deprecates shutdown()
shutdownGracefully() provides two optional parameters that give more
control over when an executor has to be shut down.

- Related issue: #1307
- Add shutdownGracefully(..) and isShuttingDown()
- Deprecate shutdown() / shutdownNow()
- Replace lastAccessTime with lastExecutionTime and update it after task
  execution for accurate quiet period check
  - runAllTasks() and runShutdownTasks() update it automatically.
  - Add updateLastExecutionTime() so that subclasses can update it
- Add a constructor parameter that tells not to add an unncessary wakeup
  task in execute() if addTask() wakes up the executor thread
  automatically.  Previously, execute() always called wakeup() after
  addTask(), which often caused an extra dummy task in the task queue.
- Use shutdownGracefully() wherever possible / Deprecation javadoc
- Reduce the running time of SingleThreadEventLoopTest from 40s to 15s
  using custom graceful shutdown parameters

- Other changes made along with this commit:
  - takeTask() does not throw InterruptedException anymore.
    - Returns null on interruption or wakeup
  - Make sure runShutdownTasks() return true even if an exception was
    raised while running the shutdown tasks
  - Remove unnecessary isShutdown() checks
  - Consistent use of SingleThreadEventExecutor.nanoTime()

Replace isWakeupOverridden with a constructor parameter
2013-05-01 10:52:38 +09:00
Norman Maurer
067a2af700 Fix a few typos 2013-04-08 21:23:53 +02:00
Norman Maurer
4505e7f1b3 Make sure OP_WRITE is correctly cleared when using FileRegion and other NioTasks 2013-04-04 08:38:58 +02:00
Trustin Lee
0f3dc0409a Log various properties at startup time for easier diagnosis 2013-04-03 11:44:30 +09:00
Trustin Lee
19ffdd5c29 Revamp the selector auto rebuild checker
- Count the number of select() calls made to wait until reaching at the expected dead line, and rebuild selectors if too many select() calls were made.
2013-03-22 14:33:47 +09:00
Trustin Lee
69e5a0eb9c Log prematurly returning select() at DEBUG level and increase the minimum required consecutive premature returns to log 2013-03-22 12:59:47 +09:00
Trustin Lee
d525295d20 Revert NioEventLoop.hasTasks() which is not really true 2013-03-22 12:46:31 +09:00
Trustin Lee
34853e7ba0 Selector auto-rebuilder tweaks 2013-03-22 12:37:11 +09:00
Trustin Lee
f6e0df125a Allow disabling automatic selector rebuilding by specifing non-positive threshold 2013-03-22 11:50:53 +09:00
Trustin Lee
1ab2813405 Enable automatic selector rebuilding by default
- Fixes #1192
- Log at WARN level for easier diagnosis
2013-03-22 11:48:41 +09:00
Trustin Lee
4097dee49d Make SingleThreadEventExecutor independent from TaskScheduler
- Related issue: #817
2013-03-22 09:00:38 +09:00
Trustin Lee
f4c18c6e74 Fix a bug where NioEventLoop.processSelectedKeys() enters an infinite loop when too many connections are closed at once
- Fixes #1171
2013-03-18 15:01:19 +09:00
Trustin Lee
9feb27d58c Specify timeout on Selector.select() 2013-03-14 08:54:33 +09:00
Trustin Lee
644d5abbda Add an empty line 2013-03-14 06:54:57 +09:00
Trustin Lee
8dcb1387e3 Add I/O ratio parameter to NioEventLoop
- Add SingleThreadEventExecutor.runAllTasks(timeout)
- Add NioEventLoop.ioRatio property
- Merge SelectorUtil into NioEventLoop
2013-03-14 06:49:08 +09:00
Norman Maurer
88cc8c1739 [#1065] Provide Future/Promise without channel reference 2013-03-07 07:21:37 +01:00
Trustin Lee
f67441354a Move logging classes from internal to internal.logging
.. because internal is crowded
2013-02-26 14:54:25 -08:00
Trustin Lee
b4f4b95739 Move io.netty.logging to io.netty.internal / Move Signal out of internal because we use it in Channel*MessageAdapters 2013-02-11 20:08:18 +09:00
Trustin Lee
a7b5d45bdf A little bit of optimization that reduces interestOps() calls 2013-02-11 10:39:50 +09:00
Norman Maurer
565e10e0db Only update interestedOps if needed 2013-02-10 20:42:40 +01:00
Trustin Lee
a4c66dc282 Reduce the number of unnecessary Selector.wakeup() / Fix a bug where channelReadSuspended() generates garbage 2013-02-09 01:05:33 +09:00
Norman Maurer
ade3cc1329 Move non socket specific stuff out of the socket package 2013-02-01 09:10:28 +01:00