GithubHelp home page GithubHelp logo

Comments (2)

sierret avatar sierret commented on May 23, 2024 1

I'm sorry. I did read the section and understand the gist of it but can't say I get every single detail. As you say multithreading is indeed pretty complex. Which is exactly why I decided to make post an issue. I suppose what I was basically asking was if the shared/regular mutexes were capable of protecting the static and internal data structures but didn't know how to phrase it. But thank you you answered my question.

from dataframe.

hosseinmoein avatar hosseinmoein commented on May 23, 2024

First, read the multithreading section in the documentation.
There are two levels of protection you need.

  1. You need to protect the DataFrame static and internal data structures that are hidden. For that, you must use my spin lock and call set_lock()
  2. You also have to protect the DataFrame columns that are exposed to the user, if a single instance of DataFrame is accessed from multiple threads. For that you can use your own separate lock (or my spin lock). It is up to you.

In general, multithreading is not as straightforward as it may sound. It requires very careful analysis and especially repeated benchmarking and tweaking. Often it is counterproductive. It also differs from one platform to another, because it depends on a particular hardware.
If you are new to multithreaded programming, I suggest you start with a single thread and maybe use the async interfaces. Once it works correctly, you can convert it to multithreaded version and compare results and efficiency and repeatedly tweak it

from dataframe.

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.