aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/win32/erl_poll.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-10-12 18:16:17 +0200
committerLukas Larsson <[email protected]>2018-12-06 11:40:14 +0100
commitc6498571109b524fb319300e1b177b942e556f1b (patch)
tree1405d7e66f47fa34cbe4b494e09c58d781276e66 /erts/emulator/sys/win32/erl_poll.c
parent790aa06d380b5842fe2fdd984bdde4f160b3adaa (diff)
downloadotp-c6498571109b524fb319300e1b177b942e556f1b.tar.gz
otp-c6498571109b524fb319300e1b177b942e556f1b.tar.bz2
otp-c6498571109b524fb319300e1b177b942e556f1b.zip
erts: Move fds with active true behaviour to own pollset
At start of the VM a poll-set that the schedulers will check is created where fds that have triggered many (at the moment, many means 10) times without being deselected inbetween. In this scheduler specific poll-set fds do not use ONESHOT, which means that the number of syscalls goes down dramatically for such fds. This pollset is introduced in order to handle fds that are used by the erlang distribution and that never change their state from {active, true}. This pollset only handles ready_input events, ready_output is still handled by the poll threads. During overload, polling the scheduler poll-set is done on a 10ms timer.
Diffstat (limited to 'erts/emulator/sys/win32/erl_poll.c')
-rw-r--r--erts/emulator/sys/win32/erl_poll.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/sys/win32/erl_poll.c b/erts/emulator/sys/win32/erl_poll.c
index 5d832f4d34..3843a27a6e 100644
--- a/erts/emulator/sys/win32/erl_poll.c
+++ b/erts/emulator/sys/win32/erl_poll.c
@@ -1018,10 +1018,11 @@ ErtsPollEvents erts_poll_control(ErtsPollSet *ps,
int erts_poll_wait(ErtsPollSet *ps,
ErtsPollResFd pr[],
int *len,
- ErtsThrPrgrData *tpd)
+ ErtsThrPrgrData *tpd,
+ Sint64 timeout_in)
{
int no_fds;
- DWORD timeout = INFINITE;
+ DWORD timeout = timeout_in == -1 ? INFINITE : timeout_in;
EventData* ev;
int res = 0;
int num = 0;