Replace posix-aio with custom thread pool

glibc implements posix-aio as a thread pool and imposes a number of limitations.

1) it limits one request per-file descriptor.  we hack around this by dup()'ing
file descriptors which is hideously ugly

2) it's impossible to add new interfaces and we need a vectored read/write
operation to properly support a zero-copy API.

What has been suggested to me by glibc folks, is to implement whatever new
interfaces we want and then it can eventually be proposed for standardization.
This requires that we implement our own posix-aio implementation though.

This patch implements posix-aio using pthreads.  It immediately eliminates the
need for fd pooling.

It performs at least as well as the current posix-aio code (in some
circumstances, even better).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5996 c046a42c-6fe2-441c-8c8c-71466251a162
6 files changed
tree: 347898a09209ea707e500da513515a72ae80377e
  1. audio/
  2. bsd-user/
  3. darwin-user/
  4. fpu/
  5. gdb-xml/
  6. hw/
  7. keymaps/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-mips/
  17. target-ppc/
  18. target-sh4/
  19. target-sparc/
  20. tcg/
  21. tests/
  22. .gitignore
  23. a.out.h
  24. aes.c
  25. aes.h
  26. aio.c
  27. alpha-dis.c
  28. alpha.ld
  29. arm-dis.c
  30. arm-semi.c
  31. arm.ld
  32. balloon.h
  33. block-bochs.c
  34. block-cloop.c
  35. block-cow.c
  36. block-dmg.c
  37. block-nbd.c
  38. block-parallels.c
  39. block-qcow.c
  40. block-qcow2.c
  41. block-raw-posix.c
  42. block-raw-win32.c
  43. block-vmdk.c
  44. block-vpc.c
  45. block-vvfat.c
  46. block.c
  47. block.h
  48. block_int.h
  49. bswap.h
  50. bt-host.c
  51. bt-vhci.c
  52. buffered_file.c
  53. buffered_file.h
  54. cache-utils.c
  55. cache-utils.h
  56. Changelog
  57. check_ops.sh
  58. cocoa.m
  59. configure
  60. console.c
  61. console.h
  62. COPYING
  63. COPYING.LIB
  64. cpu-all.h
  65. cpu-defs.h
  66. cpu-exec.c
  67. cris-dis.c
  68. curses.c
  69. curses_keys.h
  70. cutils.c
  71. d3des.c
  72. d3des.h
  73. def-helper.h
  74. dis-asm.h
  75. disas.c
  76. disas.h
  77. dyngen-exec.h
  78. elf.h
  79. elf_ops.h
  80. exec-all.h
  81. exec.c
  82. feature_to_c.sh
  83. gdbstub.c
  84. gdbstub.h
  85. gen-icount.h
  86. host-utils.c
  87. host-utils.h
  88. hostregs_helper.h
  89. hpet.h
  90. hppa-dis.c
  91. hppa.ld
  92. i386-dis.c
  93. i386.ld
  94. ia64.ld
  95. keymaps.c
  96. kqemu.c
  97. kqemu.h
  98. kvm-all.c
  99. kvm.h
  100. LICENSE
  101. loader.c
  102. m68k-dis.c
  103. m68k-semi.c
  104. m68k.ld
  105. MAINTAINERS
  106. Makefile
  107. Makefile.target
  108. migration-exec.c
  109. migration-tcp.c
  110. migration.c
  111. migration.h
  112. mips-dis.c
  113. mips.ld
  114. mipsel.ld
  115. monitor.c
  116. nbd.c
  117. nbd.h
  118. net-checksum.c
  119. net.c
  120. net.h
  121. osdep.c
  122. osdep.h
  123. posix-aio-compat.c
  124. posix-aio-compat.h
  125. ppc-dis.c
  126. ppc.ld
  127. ppc64.ld
  128. qemu-aio.h
  129. qemu-binfmt-conf.sh
  130. qemu-char.c
  131. qemu-char.h
  132. qemu-common.h
  133. qemu-doc.texi
  134. qemu-img.c
  135. qemu-img.texi
  136. qemu-lock.h
  137. qemu-log.h
  138. qemu-malloc.c
  139. qemu-nbd.c
  140. qemu-nbd.texi
  141. qemu-sockets.c
  142. qemu-tech.texi
  143. qemu-timer.h
  144. qemu-tool.c
  145. qemu_socket.h
  146. readline.c
  147. README
  148. s390-dis.c
  149. s390.ld
  150. savevm.c
  151. sdl.c
  152. sdl_keysym.h
  153. sh4-dis.c
  154. softmmu-semi.h
  155. softmmu_defs.h
  156. softmmu_exec.h
  157. softmmu_header.h
  158. softmmu_template.h
  159. sparc-dis.c
  160. sparc.ld
  161. sparc64.ld
  162. sys-queue.h
  163. sysemu.h
  164. tap-win32.c
  165. texi2pod.pl
  166. thunk.c
  167. thunk.h
  168. TODO
  169. translate-all.c
  170. uboot_image.h
  171. usb-bsd.c
  172. usb-linux.c
  173. usb-stub.c
  174. VERSION
  175. vgafont.h
  176. vl.c
  177. vnc.c
  178. vnc_keysym.h
  179. vnchextile.h
  180. x86_64.ld
  181. x_keymap.c