forked from Samsung/libtuv
-
Notifications
You must be signed in to change notification settings - Fork 0
Enabling file system
SaeHie Park edited this page Jul 15, 2015
·
4 revisions
File system in libuv
is quite complicated.
- uses macros to
INIT
,PATH
andPOST
to reduce repetitive codes. - uses thread pool for async capability. uses
uv__work_submit
inPOST
to send to work thread - thread pool uses mutex and signal
Linux uses pthread as uv_thread and pthread_mutex as uv_mutex, pthread_cond as uv_cond
Threadpool of worker
- add work calling
uv__work_submit()
withstruct uv__work
havingwork
anddone
-
work
is a function to execute in thread -
done
is a function to be called afterwork
is finished through callinguv_async_send()
-
sync
is used to handlework done
- inside async is
io
withuv__io_t
structure for holding cb and watch fd -
worker
callsuv_async_send
which callsuv__async_send()
to write one byte towa->wfd
to signal - this is watched in
uv__io_poll()
withuv__epoll_pwait()
andcb
will be called which isdone
- http://syscalls.kernelgrok.com/ for linux syscall (32bit)