Giter VIP home page Giter VIP logo

Comments (6)

SerCeMan avatar SerCeMan commented on June 27, 2024

Hi, @omllobet!

So is it possible to implement multithreading using jnr-fuse? Are there any limitations in jnr preventing that?

Yes, it is possible. No, there are no limitations. jnr-fuse is a direct wrapper around fuse that directly calls fuse methods. That also implies that your filesystem implementation has to be thread-safe.

from jnr-fuse.

omllobet avatar omllobet commented on June 27, 2024

Hi @SerCeMan
Thanks for your answer. Do you have any example of a jnr-fuse filesystem using multithreading? If not, could you give me some recommendations or hints or a general idea to get me started? For example in my mind it is not clear how a fuse operation would be translated to it's own thread in java.

Thanks

from jnr-fuse.

SerCeMan avatar SerCeMan commented on June 27, 2024

Hi, @omllobet!

You can think of it as "I don't know the thread that every single fuse method will be called on and I'll have to synchronise access to all shared state.". MemoryFS is an example of a thread-safe FS. Although it is not non-blocking, it uses synchronized.

from jnr-fuse.

omllobet avatar omllobet commented on June 27, 2024

Hi @SerCeMan

Thanks for the information, it is a read only filesystem and not very complicated, so it should be doable. It is enough to have multithreading in the filesystem just by making it threadsafe?

The calling part is where my mind has more problems. But if I understand correctly If I do 2 copy operations on the mounted filesystem each one will go to the same thread in java or not? something like cp program-> c library -> system call -> kernel -> (fuse ) -> libfuse ->java program. Do I have to create the threads in java to be able to manage various call (like in a rest program where there are some threads waiting for incoming connections) or a thread is created by libfuse for each operation?

Thanks again!

from jnr-fuse.

SerCeMan avatar SerCeMan commented on June 27, 2024

Do I have to create the threads in java to be able to manage various call

You don't have to create threads manually. Given that Java thread is a wrapper around a native thread, you'll be operating on a thread created by fuse. You can also read a discussion around a similar question: https://sourceforge.net/p/fuse/mailman/fuse-devel/thread/[email protected]/ for references.

from jnr-fuse.

omllobet avatar omllobet commented on June 27, 2024

Great, thanks for the information.

from jnr-fuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.