lkml.org 
[lkml]   [2007]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3
> long my_threadlet_fn(void *data)
> {
> char *name = data;
> int fd;
>
> fd = open(name, O_RDONLY);
> if (fd < 0)
> goto out;
>
> fstat(fd, &stat);
> read(fd, buf, count)
> ...
>
> out:
> return threadlet_complete();
> }
>
> You're telling me that runs entirely in kernel space when open()
> blocks, and doesn't touch errno if fstat() fails? Now who hasn't read
> the code?

That example touches back into user space, but doesnt involve MMU changes
or cache flushes, or tlb flushes, or floating point.

errno is thread specific if you use it but errno is as I said before
entirely a C library detail that you don't have to suffer if you don't
want to. Avoiding that saves a segment register load - which isn't too
costly but isn't free.

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

\
 
 \ /
  Last update: 2007-02-24 01:09    [W:0.171 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site