GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - feixiao/learning-libuv: learning libuv

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
cgi
cgi
 
 
detach
detach
 
 
dns
dns
 
 
helloworld
helloworld
 
 
idle-basic
idle-basic
 
 
idle-compute
idle-compute
 
 
interfaces
interfaces
 
 
locks
locks
 
 
multi-echo-server
multi-echo-server
 
 
onchange
onchange
 
 
pipe-echo-server
pipe-echo-server
 
 
plugin
plugin
 
 
proc-streams
proc-streams
 
 
progress
progress
 
 
queue-cancel
queue-cancel
 
 
queue-work
queue-work
 
 
ref-timer
ref-timer
 
 
signal
signal
 
 
spawn
spawn
 
 
tcp-echo-server
tcp-echo-server
 
 
thread-create
thread-create
 
 
threadpool
threadpool
 
 
timer
timer
 
 
tty-gravity
tty-gravity
 
 
tty
tty
 
 
udp-dhcp
udp-dhcp
 
 
udp
udp
 
 
uvcat
uvcat
 
 
uvstop
uvstop
 
 
uvtee
uvtee
 
 
uvwget
uvwget
 
 
LICENSE
LICENSE
 
 
ReadMe.md
ReadMe.md
 
 
libuv.pdf
libuv.pdf
 
 

Repository files navigation

libuv学习笔记

libuv介绍

背景

​ libuv是一个跨平台的异步IO库实现,刚开始是为Node.js而开发,Node.js完全构建于libuv之上。

跨平台构建

支持平台
  • Windows
  • Unix
  • Android
  • OS X 注:ios需要自己移植。
支持构建工具:
  • autotools
  • Visual Studio
  • Ninja
  • GYP
  • Xcode

特性

  • Full-featured event loop backed by epoll, kqueue, IOCP, event ports.
  • Asynchronous TCP and UDP sockets
  • Asynchronous DNS resolution
  • Asynchronous file and file system operations
  • File system events
  • ANSI escape code controlled TTY
  • IPC with socket sharing, using Unix domain sockets or named pipes (Windows)
  • Child processes
  • Thread pool
  • Signal handling
  • High resolution clock
  • Threading and synchronization primitives

快速入门

  • hello 启动一个loop,其他什么事情都没有做。

  • idle-basic 一个使用空转handle的例子。

  • timer 定时器实现,实现了简单的计时器功能,100毫秒之后开始触发每隔1000毫秒重复一次。

  • threadpool 使用内部的线程池,即工作队列。

  • uvcat 基于libuv实现的cat工具。

  • uvtee 基于libuv实现的tee工具(把标准输入中的内容输出到文件)。

  • onChange 监控文件变化。

  • tcp-echo-server 基于libuv的echo server实现。

  • udp-dhcp 一个从DCHP服务器获取ip的例子。

  • dns 异步解析DNS。

  • interfaces 打印出所有可以获取的网卡信息。

  • thread-create 线程的创建和停止。

  • locks 简单读写锁使用。

  • queue-work 工作队列使用的例子。

  • queue-cancel 取消未开始的工作队列。

  • progress 演示了一个下载管理程序向用户展示各个下载线程的进度。

  • spawn 创建子进程。

  • detach 创建守护进程。

  • signal 向进程发生信号。

  • proc-streams 子进程继承父进程文件描述符。

  • uvstop 演示如何停止loop。

  • ref-timer timer的使用例子。

  • idle-compute 使用uv_idle_t的例子。

  • uvwget 基于libuv实现的wget程序。

参考资料

  • libuv
  • 《User Guide》
  • libuv源码剖析:高效线程池(threadpool)的实现
  • libuv的线程池,即工作队列
  • Chinese-uvbook

About

learning libuv

Topics

libuvlibuv-sample

Resources

Readme
MIT license
Activity

Stars

9 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.