[Haskell-cafe] carry "state" around ....

Galchin, Vasili vigalchin at gmail.com
Sat Jul 19 02:40:18 EDT 2008


    Following is more of a criticism of Linux implementation of the Posix
real-time extension of asynchronous I/O.... if not interesting please skip.
The central data structure for Posix AIO is an aiocb. In any case, the Linux
implementors added to the aiocb:

/* Asynchronous I/O control block.  */
struct aiocb
  int aio_fildes;               /* File desriptor.  */
  int aio_lio_opcode;           /* Operation to be performed.  */
  int aio_reqprio;              /* Request priority offset.  */
  volatile void *aio_buf;       /* Location of buffer.  */
  size_t aio_nbytes;            /* Length of transfer.  */
  struct sigevent aio_sigevent; /* Signal number and value.  */

  /* Internal members.  */     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  struct aiocb *__next_prio;
  int __abs_prio;
  int __policy;
  int __error_code;
  __ssize_t __return_value;

#ifndef __USE_FILE_OFFSET64
  __off_t aio_offset;           /* File offset.  */
  char __pad[sizeof (__off64_t) - sizeof (__off_t)];
  __off64_t aio_offset;         /* File offset.  */
  char __unused[32];

My viewpoint is that the above "Internal members" must be "carried" around
in a Haskell program. Am I correct?? If I am correct, then the Linux
implementation of Posix AIO is not portable to say Solaris? In hindsight, if
I am correct, it seems that the Linux implementation of AIO should use the
ordered pair (pid, fd) to reference the "internal" members and leave the
"aiocb" "clean"?

Very kind regards, Vasili
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080719/b4b16e78/attachment.htm

More information about the Haskell-Cafe mailing list