Linux api part 2
Download
1 / 6

Linux API Part 2 - PowerPoint PPT Presentation


  • 194 Views
  • Uploaded on

Linux API Part 2. Dr. Michael L. Collard www.sdml.info/collard www.sdml.info/collard/linux collard@cs.kent.edu. 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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Linux API Part 2' - xaria


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

collard@cs.kent.edu


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