What is “non-blocking” concurrency and how is it different than normal concurrency?

前端 未结 8 981
滥情空心
滥情空心 2021-01-30 02:26
  1. What is \"non-blocking\" concurrency and how is it different than normal concurrency using threads? Why don\'t we use non-blocking concurrency in all the scenarios where
8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 02:51

    1. Wikipedia is a great resource for any Computer Science student. Here is an article on Non-blocking synchronization - http://en.wikipedia.org/wiki/Non-blocking_synchronization

    2. Non-blocking synchronization is available in any language, it is how the programmer defines their multi-threaded application.

    3. You should only use locking (i.e. synchronized (list) ) when necessary due to the time it takes to acquire the lock. In Java, the Vector is a thread safe data structure that is very similar to Java's ArrayList.

提交回复
热议问题