Hi All - Use link below for my popular Java courses. Virtual Threads - www.mudraservices.com/udemycoupon.html?course=vthread Java Generics - www.mudraservices.com/udemycoupon.html?course=jgen For more of my courses, check out - www.mudraservices.com
ForkJoinTask is leightweight compared to Future. I have a doubt on concurrnt programming that when we fork and execute a program, the final result is unique or different? Because lets say for a 2 core Processor 2 threads each totalling 4 running on a single run or call Method parallely. So at the end all 4 threads result the same value or different value for each?
Each thread would be performing a different activity and their results will be different. One might be a DB activity and another might be a Rest Call. I abstracted this using LongRunningTask class but you can have different implementations of Supplier interface for tasks and submit them. The program can then consolidate all the different results. Hope this answers your question !
@@viraj_shetty lets assume that I want to fibd the factorial of 100000000 using concurrent programming. I noticed that different results for the same input for different threads as my laptop is a 2 core and 2 threads per each core.
Hi All - Use link below for my popular Java courses.
Virtual Threads - www.mudraservices.com/udemycoupon.html?course=vthread
Java Generics - www.mudraservices.com/udemycoupon.html?course=jgen
For more of my courses, check out - www.mudraservices.com
Thanks 👍😊
Welcome 😊
ForkJoinTask is leightweight compared to Future. I have a doubt on concurrnt programming that when we fork and execute a program, the final result is unique or different? Because lets say for a 2 core Processor 2 threads each totalling 4 running on a single run or call Method parallely. So at the end all 4 threads result the same value or different value for each?
Each thread would be performing a different activity and their results will be different. One might be a DB activity and another might be a Rest Call. I abstracted this using LongRunningTask class but you can have different implementations of Supplier interface for tasks and submit them. The program can then consolidate all the different results. Hope this answers your question !
@@viraj_shetty lets assume that I want to fibd the factorial of 100000000 using concurrent programming. I noticed that different results for the same input for different threads as my laptop is a 2 core and 2 threads per each core.