search for: start_second_thread

Displaying 2 results from an estimated 2 matches for "start_second_thread".

2019 Jun 01
0
Re: [libnbd] Simultaneous read and write
...nd(): https://github.com/libguestfs/libnbd/blob/e63a11736930c381a79a8cc2d03844cfff5db3ef/lib/socket.c#L32 but for recv the data will come from a buffer populated by the caller using their own thread. The caller will be required to set up a second thread which does basically: pthread_create (start_second_thread); start_second_thread () { int fd = nbd_aio_get_fd (nbd); char buf[BUFSIZ]; for (;;) { poll (fd); len = recv (fd, buf, sizeof buf, 0); nbd_aio_threaded_read (fd, buf, len); } } Note this doesn't require any changes to the state machine, and probably not...
2019 May 31
4
[libnbd] Simultaneous read and write
This is a continuation of a discussion we were having on IRC. The problems with IRC are it's not recorded and it's hard to have deep technical conversations. I hope this is a decent summary. Problem simply stated: Certain NBD servers (qemu-nbd in particular) are able to simultaneously read and write on a socket. ie. They can be simultaneously reading a request and writing the reply to