Giter Site home page Giter Site logo

barrier's Introduction

Если рассматривать два барьера, то можем заметить: Тест при 8 потоках:

Num iter: 0 time to execute TestAndSet: 7903666 time to execute Array: 3716619 Time diff(T/A): 2.1265741793818522 Num iter: 1 time to execute TestAndSet: 3853205 time to execute Array: 3460381 Time diff(T/A): 1.113520447603891 Num iter: 2 time to execute TestAndSet: 4000360 time to execute Array: 3511237 Time diff(T/A): 1.1393021889436685

Тест при 6 потоках: Num iter: 0 time to execute TestAndSet: 8296090 time to execute Array: 3147524 Time diff(T/A): 2.6357511491572425 Num iter: 1 time to execute TestAndSet: 2273098 time to execute Array: 2279517 Time diff(T/A): 0.9971840525865786 Num iter: 2 time to execute TestAndSet: 3412958 time to execute Array: 2725583 Time diff(T/A): 1.252193750841563 Num iter: 3 time to execute TestAndSet: 2579652 time to execute Array: 2648253 Time diff(T/A): 0.9740957529359922 Num iter: 4 time to execute TestAndSet: 2785716 time to execute Array: 2685939 Time diff(T/A): 1.0371479024653947

С при большом кол-ве потоков TaS получался быстрее. Это логично так, как при работе в Array поток один дважды тормозит все другие потоки. А при TaS лишь только, если он был последним.

Первую же итерацию можно назвать разогревочной, потому, что потоки новые не всегда сразу создаются, а лениво для оптимизации, поэтому может отличаться время.

barrier's People

Contributors

tiger20111 avatar

Watchers

 avatar  avatar

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.