8000 Documentation and examples for blocking vs non-blocking reads and writes · Issue #1241 · libfuse/libfuse · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Documentation and examples for blocking vs non-blocking reads and writes #1241
Open
@cmcqueen

Description

@cmcqueen

It's not clear how a FUSE or CUSE device should implement blocking vs non-blocking reads and writes. (This is probably more important for a CUSE device with sporadic read data or bandwidth-limited write data.)

I asked about this earlier on StackOverflow for CUSE: Linux CUSE: How to implement blocking or non-blocking operation.

My conclusion was that the CUSE read and write functions should check fi->flags & O_NONBLOCK and behave differently depending on whether the bit is set or not.

It would be good to have documentation and examples to address this design question.

For blocking operation, I assume use of pthread_cond_wait() and pthread_cond_signal() is a likely implementation strategy. Meanwhile, it appears that the implementation of .poll functionality requires the use of struct fuse_pollhandle pointers and fuse_notify_poll(). Is there some way to use a single mechanism to achieve both, or is it necessary for both to be used in a fully-functional CUSE driver?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0