Description
We currently rely on a hack to decide whether we should call accept() or pop() in a given queue descriptor:
|
/* BIG HACK: we always use the first queue descriptor for |
|
listening, so we know to call accept instead of pop */ |
|
if (fd == 0) |
|
ret = dmtr_accept(&qt, fd); |
|
else ret = dmtr_pop(&qt, fd); |
We cannot make any assumptions about the values of a queue descriptor.
Quoting @iyzhang :
I think the correct fix would be to change Redis to pass into the function whether the socket is for listening or connecting. The issue is that there is just a single function/function pointer to register all sockets because epoll doesn't differentiate between listening sockets and receiving sockets. However, we need to issue the first operation on the socket to get the queue token (vs epoll which just takes a registration for a generic read event).
Description
We currently rely on a hack to decide whether we should call
accept()orpop()in a given queue descriptor:redis/src/ae_demikernel.c
Lines 105 to 109 in 19f0d8a
We cannot make any assumptions about the values of a queue descriptor.
Quoting @iyzhang :