Linux api part 2
This presentation is the property of its rightful owner.
Sponsored Links
1 / 6

Linux API Part 2 PowerPoint PPT Presentation


  • 143 Views
  • Uploaded on
  • Presentation posted in: General

Linux API Part 2. Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux [email protected] Threading: pthreads. POSIX threads NPTL (Native Posix Thread Library) Red Hat “Won” over NGPT (Next Generation Posix Threads) RHEL 3, Linux Kernel 2.6, GNU C Library

Download Presentation

Linux API Part 2

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Linux api part 2

Linux API Part 2

Dr. Michael L. Collard

www.sdml.info/collard

www.sdml.info/collard/linux

[email protected]


Threading pthreads

Threading: pthreads

  • POSIX threads

  • NPTL (Native Posix Thread Library)

    • Red Hat

    • “Won” over NGPT (Next Generation Posix Threads)

    • RHEL 3, Linux Kernel 2.6, GNU C Library

  • Performance: Create 100,000 threads on IA-32

    • NPTL off: 15 minutes

    • NPTL on: 2 seconds


Zero copy

Zero-Copy

  • Use read/write as before

    • Multiple copies in/out of kernel mode

  • mmap – memory map input file

    • Eliminates copy from input file

  • sendfile – copies data in the kernel

    • Limited to socket file descriptor for output


Read write

read/write

read(infd, buf, len)

write(outfd, buf, len)

“Zero Copy I: User-Mode Perspective” by Dragan Stancevic http://www.linuxjournal.com/article/6345


Mmap write

mmap/write

buf = mmap(infd, len)

write(outfd, buf, len)

“Zero Copy I: User-Mode Perspective” by Dragan Stancevic http://www.linuxjournal.com/article/6345


Sendfile

sendfile

sendfile(infd, outfd);

“Zero Copy I: User-Mode Perspective” by Dragan Stancevic http://www.linuxjournal.com/article/6345


  • Login