I'm running rumprun on qemu (hw target) using e1000 (wm0, configured with DHCP) with the following code snippet:
// A: sched_yield();
char buf[64];
pkt_sent = 0;
while (pkt_sent < 3) {
sprintf(buf, "pkt %zu\n", pkt_sent);
if (sendto(fd, buf, strlen(buf)+1, 0, dst, sizeof(struct sockaddr_in)) >= 0)
pkt_sent++;
else {
printf("errno %d: %s\n", errno, strerror(errno));
exit(1);
}
// B: sched_yield();
}
// C: sched_yield();
On the receiver (listening on a tap device) I get the following output:
With the same code on Linux I see the following 3 messages on the receiver socket:
With uncommenting sched_yield calls I see the following outputs:
Unikernel (uncomment line A):
Unikernel (uncomment line B):
Unikernel (uncomment line C):
Unikernel (uncomment line A,B,C):
I have the following questions to help my understanding of the cooperative scheduling model:
- How do I send pkt 0 with the unikernel?
- Is there a better way to send multiple packets without inserting calls to sched_yield (e.g., will a proper poll/select loop etc. take care of this?)
- Is it a bug that sendto() does not return with an error, even though the message for pkt 0 was never sent?
I'm running rumprun on qemu (hw target) using e1000 (wm0, configured with DHCP) with the following code snippet:
On the receiver (listening on a tap device) I get the following output:
With the same code on Linux I see the following 3 messages on the receiver socket:
With uncommenting sched_yield calls I see the following outputs:
Unikernel (uncomment line A):
Unikernel (uncomment line B):
Unikernel (uncomment line C):
Unikernel (uncomment line A,B,C):
I have the following questions to help my understanding of the cooperative scheduling model: