futures/fibers and synchronous file API

130 views
Skip to first unread message

Roman Gershman

unread,
Dec 16, 2017, 8:20:59 AM12/16/17
to Folly: the Facebook Open-source LibrarY
Hi,

Is it possible to use modern async primitives like future/fibers with files IO? 
Lets say I need to read a large and slow file and I have only a synchronous API (posix open()).
Can I somehow make it work with background worker thread that reads the file and sends data to fiber task?

Files is just an example.
* I understand how fibers works if everything in the system works together with them and is fully cooperative and non-blocking (i.e. waits on each lock/block) but how do I integrate with
synchronous third-party code? How can we communicate with other threads inside a fiber?

Cheers,
  
Reply all
Reply to author
Forward
0 new messages