Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3



On Wed, 28 Feb 2007, Chris Friesen wrote:

Davide Libenzi wrote:

struct async_syscall {
unsigned long nr_sysc;
unsigned long params[8];
long *result;
};

And what would async_wait() return bak? Pointers to "struct async_syscall"
or pointers to "result"?

Either one has downsides. Pointer to struct async_syscall requires that the
caller keep the struct around. Pointer to result requires that the caller
always reserve a location for the result.

Does the kernel care about the (possibly rare) case of callers that don't want
to pay attention to result? If so, what about adding some kind of
caller-specified handle to struct async_syscall, and having async_wait()
return the handle? In the case where the caller does care about the result,
the handle could just be the address of result.

Something like this (with async_wait() returning asynid's)?

struct async_syscall {
long *result;
unsigned long asynid;
unsigned long nr_sysc;
unsigned long params[8];
};



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3
    ... Pointer to struct async_syscall requires that the ... Pointer to result requires that the caller ... Does the kernel care about the case of callers that don't want ...
    (Linux-Kernel)
  • Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3
    ... or pointers to "result"? ... Pointer to result requires that the caller always reserve a location for the result. ... Does the kernel care about the case of callers that don't want to pay attention to result? ... If so, what about adding some kind of caller-specified handle to struct async_syscall, and having async_waitreturn the handle? ...
    (Linux-Kernel)
  • Re: How to return an array of own datatype
    ... You can return a struct that contains an array. ... caller provide a pointer to an array argument that you fill with ... You can return a pointer to an array that you got ...
    (comp.lang.cpp)
  • Re: how to store list of varying types
    ... represent that with those in the struct definitions? ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ... start with an upper-case letter (so, I would use DataElement ...
    (microsoft.public.vc.mfc)
  • Re: N1298 - try/finally for C
    ... Do you mean that "struct throwInfo" should be optional? ... that exception handling would be supported only on implementations ... If the standard mandates an integer as throw argument, ... should be an integer wide enough to encode a pointer if necessary. ...
    (comp.std.c)