Commit a681dbfd authored by Florian Fischer's avatar Florian Fischer
Browse files

[IO] only try syscall on Future::submit if it has no dependencies

parent 3b7a60ff
Pipeline #55374 passed with stages
in 9 minutes and 57 seconds
...@@ -164,10 +164,13 @@ class SendFuture : public Future { ...@@ -164,10 +164,13 @@ class SendFuture : public Future {
void submit() { void submit() {
if constexpr (emper::IO_TRY_SYSCALL) { if constexpr (emper::IO_TRY_SYSCALL) {
ssize_t res = ::send(fd, buf, len, offsetOrFlags | MSG_DONTWAIT); // Only try to complete using a syscall if we have no dependencies
if (!dependency) {
ssize_t res = ::send(fd, buf, len, offsetOrFlags | MSG_DONTWAIT);
if (res > -1 || (errno != EAGAIN && errno != EWOULDBLOCK)) { if (res > -1 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
complete(res > 0 ? res : -errno); complete(res > 0 ? res : -errno);
}
} }
} }
...@@ -186,10 +189,13 @@ class RecvFuture : public Future { ...@@ -186,10 +189,13 @@ class RecvFuture : public Future {
void submit() { void submit() {
if constexpr (emper::IO_TRY_SYSCALL) { if constexpr (emper::IO_TRY_SYSCALL) {
ssize_t res = ::recv(fd, buf, len, offsetOrFlags | MSG_DONTWAIT); // Only try to complete using a syscall if we have no dependencies
if (!dependency) {
ssize_t res = ::recv(fd, buf, len, offsetOrFlags | MSG_DONTWAIT);
if (res > -1 || (errno != EAGAIN && errno != EWOULDBLOCK)) { if (res > -1 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
complete(res > 0 ? res : -errno); complete(res > 0 ? res : -errno);
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment