STIW3054-A191 / Main-Issues

3 stars 2 forks source link

Youtube Video #6

Open zhamri opened 4 years ago

zhamri commented 4 years ago

Instruction

Find and watch a good youtube video on any concurrency topics. The link below will guide you on how to identify the topic

https://github.com/zhamri/MyClass-STIW3054/wiki

Submission

  1. Matric number
  2. Link of the video
  3. Title of the video
  4. Summarize what you have learned from the video
jasonway96 commented 4 years ago
  1. 256750

  2. https://www.youtube.com/watch?v=y85G7GLYhYA

  3. What is Concurrent Programming?

  4. a) What is concurrent? Describe things that are occurring, or people who are doing something, at the same time, such as "concurrent users" of a computer program.

    b) What is concurrent programming/computing? In a concurrent program, several streams of operations may execute concurrently. Each stream of operations executes as it would in a sequential program except for the fact that streams can
    communicate and interfere with one another.

    c) Concurrency vs Parallelism Concurrency is a task start, run, and complete in overlapping time periods. Parallelism is a tasks run simultaneously.

PhuahMeiQi commented 4 years ago
  1. Matric number: 259501
  2. Link of the video: https://www.youtube.com/watch?v=8Je1W82vwYM
  3. Title of the video: concurrency vs parallelism
  4. Summarize what you have learned from the video: I have learn the definition of concurrency and parallelism, the goal, perspective and resource utilization of concurrency and parallelism. The concurrency will executing multiple task on the single core and parallelism executing multiple task on multiple hardware.
vissanuck commented 4 years ago
  1. 256609
  2. https://www.youtube.com/watch?v=_RSAS-gIjGo
  3. Java Concurrency Interview Question
  4. Java Concurrency(Multi Threading) can execute multiple task at the same time. shutdownNow () is not guarantee to stop all the thread that in the coding.Java thread cannot be killed.Using interrupt method to stop the threads.Volatile boolean can keep the values of variables in a thread's working memory in sync with their values in the main memory.
TanChengYi commented 4 years ago
  1. Matric number : 253814
  2. Link of the video : https://www.youtube.com/watch?v=ADxUsCkWdbE
  3. Title of the video : Concurrency Concepts in Java by Douglas Hawkins
  4. Summarize what you have learned from the video: Atomicity -What operations are invisible? -Succinct not equal to atomic Ordering -What order does it run in? -Store sooner,Free to order -to not reorder> Synchronization actions Visibility -What can other threads see? -NOT ALL VALUES ARE STORED

Concurrency can seem broken, counter intuitive, paradoxical despite the rules

farisleh commented 4 years ago
  1. Matric Number : 255312

  2. Link of The Video : https://www.youtube.com/watch?v=ltTQaMSk6ME

  3. Title of the video : Concurrency vs Parallelism : Difference between them with examples & Comparison Chart

  4. Summarize what you have learned from the video: This video tutorial explains about the concept of concurrency and parallelism used in the operating system, the difference between them using the comparison chart along with the suitable example. Parallelly executing processes must be concurrent unless they are operated at the same instant but concurrently executing processes could never be parallel because these are not processed at the same instant.

Quitetve commented 4 years ago
  1. Matric number 256510
  2. Link of the video https://www.youtube.com/watch?v=wNns0kIDC68
  3. Title of the video Threading Issues (Thread Cancellation)
  4. Summarize what you have learned from the video **Thread cancellation is a process terminating a thread before it has completed. example when user press stop button in web browser from loading further. another thread will be cancelled. two different cancellation scenario:
    1. synchronous cancellation.
    2. deferred cancellation.**
macasyraf commented 4 years ago
  1. 256599

  2. https://www.youtube.com/watch?v=px4W-HXRWKk

  3. Thread Safety in Java (Youtube)

Mutation and Immutability Mutation means we can change the variable meanwhile immutability can't. We just cannot change the variable when assigned. So, mutation is better than immutability.

Synchronized Keyword By using this keyword, it will be calling by one thread. Means that, Thread 1 will process and Thread 2 has to wait.


public synchronized void increment()
{
     count++;
}

Thread Safety The meaning of thread safety is that the method will be executed only by one thread and not both.

aafham commented 4 years ago
  1. 250634

  2. 55 NewThings in Java 7 - Concurrency

  3. 55 NewThings in Java 7 - Concurrency

  4. to manage a number of tasks whose intermingling will make more efficient use of the computer (including the ability to transparently distribute the tasks across multiple CPUs), allow better code organization, or be more convenient for the user.

coNNectGan commented 4 years ago
  1. Matric number: 255108
  2. Link of the video: https://www.youtube.com/watch?v=fzYLtYaJ_D0
  3. Title of the video: Java Thread States - Fastthread.io
  4. As a summary of the video: a)BLOCKED STATE - A Thread will enter into BLOCKED STATE when it's waiting for a monitor lock to enter a synchronized block/method or reenter a synchronized block/method after calling Object#wait() method. b)WAITING STATE - A Thread will enter into WAITING STATE when it's calling one of the following methods:
    Object#wait() with no timeout Thread#join()with no timeout LockSupport#park() c)TIMED WAITING STATE - A Thread will enter into TIMED_WAITING state when it's calling one of the following methods: Thread#sleep() Object#wait()with timeout Thread#join()with timeout LockSupport#parkNanos() LockSupport#parkUntil()

Overall, the scenario of the video has explained these 3 states perfectly.

liviniesh commented 4 years ago
  1. Matric number 255101
  2. Link of the video https://www.youtube.com/watch?v=shH38znT_sQ
  3. Title of the video Semaphore in Java Concurrency
  4. Summarize what you have learned from the video This video is try to explain difficult concepts like Java concurrency in simple to understand manner using animations and small code snippets. It allows the code in better way and easiest way to restrict or manage access to constrained resources.
ychian234 commented 4 years ago

1) 259187

2) https://www.youtube.com/watch?v=FChZP09Ba4E

3) Concurrency vs Parallelism

4) Summarize what you have learned from the video

Parallelism allows multiple tasks to run on different cores. To enable parallelism in java, we can use Threads or Threadpool but we had to ensure that our CPU has more than one core so that we can run multiple cores. Concurrency only use one core. It may lead to error if it doesn't has "lock" command. "Concurrency is about dealing with lot of things at once."

yyjmax commented 4 years ago

1.243147

2.https://www.youtube.com/watch?v=FChZP09Ba4E&list=PLhfHPmPYPPRk6yMrcbfafFGSbE2EPK_A6&index=1

3.Concurrency vs Parallelism

4.a)Concurrency is about dealing with lot of things at once.

b) Shared resource is to be accessed/updated or multiple tasks need to coordinate

c)Tools to deal with concurrency: Locks/synchronized Atomic classes Concurrent data structures completableFuture CountdownLatch/Phaser/CyclicBarrier/Semaphore etc.

d)Concurrency + Parallelism Split the sequential flow into independent components Use threads/thread-pools to parallelism (& thus speed up) Whenever share resource is to be updated, use concurrency tools to manage state Whenever independent components (running on threads) need to coordinate, use concurrency tools

muhdhariz commented 4 years ago
  1. Matric No.: 256549
  2. Video link: Understanding how ForkJoinPool works
  3. Video title: Understanding how ForkJoinPool works
  4. Summarize Difference between Executer Service and ForkJoinPool
    • Tasks producing sub-tasks a.k.a. ForkJoin i. It is optimize for the problems for the tasks to produce sub-tasks
    • Per-thread queueing & Work-stealing i. each thread have deque(double ended que) and the thread can easily pick the task after forking into sub-task that stored within deque ii. if a thread have no task and already finish it task, then it will steal the task from the other thread to distribute the workload
Gv3N commented 4 years ago

252709 Video Link: https://www.youtube.com/watch?v=Xj1uYKa8rIw Video Title: 13.2 Multi threading in Java Practical Lesson Learned: What I learn is how to use thread and what the necessary to use them. I also learned how to control the behavior of the thread by using sleep and causing delay in between thread start() in order to make the thread execute accordingly to our desire.

prayat15 commented 4 years ago
  1. Matric number 250615

  2. Link of the video https://www.youtube.com/watch?v=QVeHgraetEA

  3. Title of the video The Java Fork-Join Pool Framework

  4. Summarize what you have learned from the video

peipei28 commented 4 years ago

1. Matric number 254251

2. Link of the video https://www.youtube.com/watch?v=TCd8QIS-2KI

3. Title of the video Java Threads Tutorial

4.Summarize what you have learned from the video This video is explaining the basic about thread. It gives detailed explanation about how to create thread and work with multiple thread.

WwLuo-1024 commented 4 years ago

1.Matric number:251230

2.Link of the video:https://www.youtube.com/watch?v=fbpEs51JfdU

3.Title of the video:Concurrency and Parallel Programming in Java

4.Summarize what you have learned from the video --Concurrency happens when multiple copies of the same program are run at the same time, but in the course of their execution, those copies communicate with each other. In many simple concurrent applications, you use a single machine, and the program’s instruction code is only loaded into memory once—in other words, a single process is created—but the process’s execution has multiple threads. Each thread remembers which instruction it’s on, and executes that instruction before going on to the next one; thus, the various threads in a process each follow their own control flow, but can make decisions based on information they receive from other threads.

Parallelism is when multiple copies of the same program are run at the same time, but on different data, and not necessarily on the same machine. For example, a search engine company would use a large number of machines to crawl the web, and each of those machines would be running a program that sends requests out to websites, but each copy of the program is given a different list of URLs, and will therefore produce a different set of downloaded content. You could say that all the copies of the program run “in parallel”, so they will get the job done faster than if there was just one machine that would go through the entire list of URLs, one at a time. When you use parallelism, you can refer to each copy of the program as one “instance” or one “replica”.

sonyhana7 commented 4 years ago

1.Matric number: 246210

  1. Link of the video: https://www.youtube.com/watch?v=b5sj13Z7aho

  2. Title of the video: Java Threads Tutorial 1 - Introduction to Java Threads

  3. Summarize what you have learned from the video:

Difference multitasking and multithreading is multitasking refers to a computer’s ability to peform multi jobs concurrently and multithreading refers to multiple threads of controls within single program. Difference between concurrency and parallelism . If consider have one cpu and want to run two browser, cpu will allocate priority to the processes and this is concurrency and if have two cpu and each process will run each processer in call parallelism. An executing instance of a program is called a process. A thread is a subset of the process. Threads share the address space of the process that created it; processes have their own space. The purpose of threads is to maintain responsiveness of an application during a long time running task. To enable cancellation of separable tasks. Some problems are instrinsically parallel. When we execute an application. The JVM creates a thread object whose task is defined by the main () method. There are two ways in creating thread object is by subclassing the Thread class ans instantiating a new object of the class and implementing the Runnable interface.

najihahF commented 4 years ago
  1. 247991

  2. https://www.youtube.com/watch?v=_RSAS-gIjGo&t=161s

  3. Java Concurrency Interview Question: How to timeout a thread?

  4. This video show how to stop a particular thread and how to do it after a certain time out we want to able to stop that particular task. This video also show how to use interrupts, volatiles or AtomicBooleans to stop the thread and Thread.sleep or Schedulers for conditional timeouts.

if we execute the method shutdown() or shutdownNow() does it stop the thread?

shutdown() -not accept any new tasks -whatever previously submitted tasks are there in the queue which are not executed it executes them

shutdownNow() -no new tasks accepted -previously submitted task waiting in the queue are returned -tasks being run by the thread(s) are attempted to stop

sufyankamal commented 4 years ago
  1. 255541
  2. https://www.youtube.com/watch?v=FChZP09Ba4E&list=PLhfHPmPYPPRk6yMrcbfafFGSbE2EPK_A6
  3. Concurrency vs Parallelism
  4. This video basically clear the confusion about parallelism and concurrency, and what tools Java provides to enable each concept. Complex concepts explained in short & simple manner. Topics include Java Concurrency, Spring Boot, Microservices, Distributed Systems etc. In this video, it it stated that Parallelism is about doing lot of thins at once. Furthermore, it explain that tools to enable Parallelism are thread, threadPool (ExecutorService, ForkJoinPool,CustomThreadPool) and require more than 1 cpu core.
Nurshafiqahdiela commented 4 years ago
  1. 259383
  2. https://www.youtube.com/watch?v=pWTtPnwialI
  3. Thread Safety
  4. Thread safety can be invoked in multiple threads at the same time. Resources are protected from simultaneous access and there is no undefined behavior. Thread safe code complicated. Thread safe can involve trade offs and be challenging to implement. Levels of thread safety are thread safe and conditinally thread safe. Thread safety also using API documentation like provides must be documentation and establish consistent and accurate vocabulary.
fazlizam96 commented 4 years ago
  1. 259132
  2. https://www.youtube.com/watch?v=FChZP09Ba4E&list=PLhfHPmPYPPRk6yMrcbfafFGSbE2EPK_A6
  3. Concurrency vs Parallelism
  4. This video explains about the concept of concurrency and parallelism used in the operating system, the difference between them using the comparison chart along with the suitable example. Complex concepts explained in short & simple manner. Topics include Java Concurrency, Spring Boot, Micro services, Distributed Systems etc. Paralleled executing processes must be concurrent unless they are operated at the same instant but concurrently executing processes could never be parallel because these are not processed at the same instant.
weiditan commented 4 years ago
  1. Matric number 259296

  2. Link of the video https://www.youtube.com/watch?v=TCd8QIS-2KI

  3. Title of the video Java Threads Tutorial | Multithreading In Java Tutorial | Java Tutorial For Beginners | Edureka

  4. Summarize what you have learned from the video From this video I learned java Life cycle have New, Runnable, Running, Waiting, Terminated. How to creating a thread, What is Main Thread, Multi-Threading and Thread Pool.

aidqayyum commented 4 years ago
  1. Matric No: 253288
  2. Link : https://www.youtube.com/watch?v=_RSAS-gIjGo
  3. Title: Java Concurrency Interview Question: How to timeout a thread?
  4. Summarize : This video show how to stop a thread or particular task at certain time for example if it exceeds 10 minutes. For this video, he divided to two parts which is how to stop a particular thread and how to stop it after a certain time. threadPool. For the threadPool we can use either “shutdown()” or “shutdownNow()” but it will not accept any new task that are going to submit to the thread pool, and whatever previously submitted tasks are there in the queue which are not yet executed, it executes them. shutdownNow() method will return any of the tasks which are waiting to be executed in the ques and any of the task which are currently being run by the thread are just attempted to stop. To stop a task or thread, we need to use either “interrupts” or “volatiles”. For, “interrupts” is what is used by three other concurrent utility in an attempt to stop the thread. To stop a task we can use “ScheduledExecutorService” where we are scheduling stopping off our task after 10 minutes so we are saying that run this particular operation after 10 minutes and within that operation.
chinsfuh commented 4 years ago
  1. 256643
  2. https://www.youtube.com/watch?v=cwDqjmSmtMQ
  3. Java synchornization and multi thread

Java synchronnization is to access of multiple threads which are trying to access the common shared resources but it produce problem.

If don't implement synchronization, problem occurs:

  1. thread interference
  2. memory inconsistency

When process is created, separate memory location is created,it need to create in registries, whenever a context switch between one process to another process it happens, it needs to save the current state of in a thread and then current state up in the process and then we switch to the new process

Java synchronization apply into 3 levels:

  1. synchronized block
  2. synchronized method
  3. synchronized class

Advantages of synchronization: -maintain the consistency between memory consistency and will stop the interpreting the thread with another thread.

sohcheefung commented 4 years ago
  1. Matric No: 259521
  2. Link: https://www.youtube.com/watch?v=EIGkKV49lt8
  3. Title: Background on Java Concurrency and Parallelism
  4. Summarize: Understand the meaning of concurrency: Concurrency is a design where you structure your program into different tasks in a way that, if you run them sequentially or in parallel mode, the final result of the program will remain same. It is independent of the threads, you can run it on single core (or) multi-core the result of program will be same. Concurrency is a way to deal the things.

Understand the meaning of Parallelism: Parallelism is a form of computing that parititions task into sub-task can run independently& whose partial result are combined.

Brief history of concurrency: -Foundational concurrency support -Advanced concurrency support -Foundational parallelism support(focus on data parallelism that runs the same task on different data elemenst)

OXunSheng commented 4 years ago
  1. Matric number : 253881
  2. Link of the video : https://www.youtube.com/watch?v=ltTQaMSk6ME
  3. Title of the video : Concurrency vs Parallelism : Difference between them with examples & Comparison Chart
  4. Summarize what you have learned from the video : Concurrency is when two tasks can start, run, and complete in overlapping time periods. Parallelism is when tasks literally run at the same time, for example on a multi-core processor. Also, Concurrency is the composition of independently executing processes, while parallelism is the simultaneous execution of (possibly related) computations. As conclusion, Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.
SilentHlive commented 4 years ago

1.Matric number = 255227 2.Link of the video = https://www.youtube.com/watch?v=L95658yXRgI 3.Title of the video = MultiThreading in Java Theory 4.Summarize what you have learned from the video The video explains what is multithreading and the example. The video also explain uses of threads such as using a complete power of CPU, Asynctask in Android, creating web application and gaming.

AhmedBawazir2020 commented 4 years ago
  1. 249879
  2. Link: https://youtu.be/RH7G-N2pa8M 3.Title of the video: 13.7 Multithreading Synchronized Keyword 4.Summarize what you have learned from the video I learning from this video if you have many threads and you want word together but without mix in one result. When I want one thread start in another thread started after finishing the first one we use Synchronized to make it separate wording
ghost commented 4 years ago

1) matric no :255403 2) https://www.youtube.com/watch?v=rzjtuzmU948 3) thread states

4) know how thread life cycle from runnable,sleping time wait, waiting,dead state and blocked i/d synchronized

thineshsubramani commented 4 years ago
  1. Matric number : 254423
  2. Link of the video : https://www.youtube.com/watch?v=FChZP09Ba4E Title of the video : Concurrency vs Parallelism Summarize what you have learned from the video: Concurrency is when two tasks can start, run, and complete in overlapping time periods. Parallelism is when tasks literally run at the same time, eg. on a multi-core processor.

Concurrency is the composition of independently executing processes, while parallelism is the simultaneous execution of (possibly related) computations.

Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.

An application can be concurrent – but not parallel, which means that it processes more than one task at the same time, but no two tasks are executing at same time instant.

An application can be parallel – but not concurrent, which means that it processes multiple sub-tasks of a task in multi-core CPU at same time.

An application can be neither parallel – nor concurrent, which means that it processes all tasks one at a time, sequentially.

An application can be both parallel – and concurrent, which means that it processes multiple tasks concurrently in multi-core CPU at same time .

That’s all about Concurrency vs. Parallelism, a very important concept in java multi-threading concepts.