#18 Bakery's algorithm | Solving Critical Section Problem | Bakery Algorithm in Process

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024
  • Bakery's algorithm example,
    Bakery's algorithm pdf,
    Lamport bakery's algorithm,
    bakery algorithm example,
    bakery algorithm in os,
    bakery algorithm in os pdf,
    bakery algorithm in c,
    bakery algorithm code,
    #algorithm #bakery #problem

Комментарии • 8

  • @roycrxtw
    @roycrxtw 11 месяцев назад +5

    A thumbs up for your clear English.

  • @MuhammadWajahatHussain-f6z
    @MuhammadWajahatHussain-f6z 8 месяцев назад

    It really was short and clear to grab the concept. Hats off for you man.

  • @pratikkumarbulani8903
    @pratikkumarbulani8903 2 месяца назад +1

    The braces in the code are incorrectly placed. The actual code is:
    lock(i): // Here process i is trying to acquire the lock
    choosing[i] = true
    token[i] = 1 + MAX(token[0], token[1], ..., token[n-1]) // Here n = number of parallel processes trying to execute the critical section
    choosing[i] = false
    for(p = 0; p < n; p++):
    while(choosing[p]);
    while(token[p] != 0 && (token[p], p) < (token[i], i));
    done
    unlock(i): // Here process i is trying to release the lock
    token[i] = 0;
    done

    • @academia3303
      @academia3303  2 месяца назад

      @@pratikkumarbulani8903 thanks

  • @OghamTheBold
    @OghamTheBold 6 месяцев назад

    Should it be - while ( choosing[j] ); 👈
    It is confusing without the locks - I think the locks are the key

  • @AKPK-u5d
    @AKPK-u5d 7 месяцев назад

    Can you send me the link of PPT which is used in these videos