Чашечка Java
الذهاب إلى القناة على Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
إظهار المزيد8 539
المشتركون
-324 ساعات
-127 أيام
-2930 أيام
أرشيف المشاركات
8 540
Однопоточный JavaScript и многопоточная Java: что быстрее?
Асинхронное выполнение на Java и JavaScript
При необходимости в JavaScript можно запускать дополнительные потоки. Но обычно в Node.js или в браузерах весь код на JavaScript выполняется в одном потоке. В браузерах один и тот же поток рендерит содержимое веб-страницы на экран. По сути, один поток выполнения занимается всеми задачами, потому что приложения JavaScript пользуются преимуществами асинхронного выполнения. Для асинхронного выполнения задача помещается в очередь задач. Задачи из очереди одна за другой выполняются единственным потоком. Например, вторая строка кода выполняет планирование асинхронной задачи, которая запускается после завершения текущей задачи:
console.log("1");
setTimeout(()=>console.log("2"));
console.log("3");
Результатом работы кода будет 1 3 2.
В Java API под асинхронным выполнением обычно подразумевается, что задача выполняется в новом выделенном потоке. Например, представленный ниже код при помощи метода supplyAsync() планирует асинхронную задачу:
System.out.println("current thread: " + Thread.currentThread().getName());
var future = CompletableFuture.supplyAsync(() -> Thread.currentThread().getName());
System.out.println("current thread: " + Thread.currentThread().getName());
System.out.println("task thread: " + future.get());
Результат работы программы показывает, что текущий поток создал новый поток для выполнения задачи:
current thread: main
current thread: main
task thread: ForkJoinPool.commonPool-worker-1
Проблема множественных потоков заключается в том, что Java runtime не может создавать бесконечное их количество. Когда все запущенные потоки ожидают, а новые потоки создать нельзя, приложение тоже ничего не будет делать.
Читать: https://habr.com/ru/post/592017/?utm_campaign=5920178 540
Top 10 Java 8 Tutorials, Classes, and Courses in 2022 - Best of Lot [UPDATED]
Hello guys, if you want to learn Java 8, in a particular lambda expression, Stream API, method reference, and new Date and Time API, and looking for the best resources then you have come to the right...
Read: http://www.java67.com/2014/09/top-10-java-8-tutorials-best-of-lot.html
8 540
Top 7 Free Selenium Courses for Beginners to Learn Online in 2022 - Best of Lot
Testing is an integral part of software development. We have long relied on manual testing by testers and QA professionals to ship quality software and find bugs, but that's not sustainable...
Read: http://www.java67.com/2018/02/7-free-selenium-web-deriver-courses-for-java-C-developer.html
8 540
Top 5 Free HTML and CSS Courses for Beginners to Learn in 2022 - Best of Lot
HTML and CSS are two pillars of web development, they are used to create web pages you see every day. HTML provides the structure to your web page, and CSS gives them the style to look better. If you...
Read: http://www.java67.com/2018/02/5-free-html-and-css-courses-to-learn-web-development.html
8 540
Top 5 Scrum Master Courses & Tests to Crack PSM Certification in 2022 - Best of Lot
If you want to become a Scrum Master and grow your career, or preparing for Scrum Master Certification (PSM) in 2022 and looking for the best Scrum courses, classes, books, and tutorials, then you...
Read: http://www.java67.com/2021/03/best-professional-scrum-master-psm-certifcation-courses-and-tests.html
8 540
Top 6 Online Course to learn Java 9, 10, 11,12 and 14 in 2022 - Best of Lot
Hello guys, even though Java 15 is available now, many developers are still on Java 8 and not really caught up with changes in Java 9, 10, 11, 12, 13, or Java 14. If you are also in the same boat and...
Read: http://www.java67.com/2018/02/5-online-courses-to-learn-java-9-better.html
8 540
5 Best Git Online Courses for Beginners to Learn in 2022 [UPDATED]
Hello guys, if you want to learn Git and Github and looking for the best resources then you have come to the right place. Earlier, I have shared free Github courses and free websites, and in this...
Read: http://www.java67.com/2019/04/top-5-courses-to-learn-git-and-github.html
8 540
Top 5 Free Microsoft Power BI Online Courses for Beginners to Learn in 2022 - Best of Lot
Hello guys, if you want to learn Power BI in 2022, one of the leading too for Data Visualization and Business Analytics, and looking for free resources like free online courses, books, and tutorials,...
Read: http://www.java67.com/2021/05/top-5-free-power-bi-courses-for..html
8 540
Microsoft Continues Its Embrace of Java by Joining JCP
Microsoft joined the Java Community Process (JCP), which governs the Java language evolution. This continues Microsoft's embrace of Java, such as having its own OpenJDK distribution and constantly improving Java support in Visual Studio Code. Microsoft is also a strategic member of both the Eclipse Foundation and the Eclipse Working Group for Adoptium. Adoptium was formerly known as AdoptOpenJDK.
By Karsten Silz
Read: https://www.infoq.com/news/2021/11/micosoft-joins-jcp/
8 540
Top Java Blogs Weekly: Best of 49/2021
Best of Top Java Blogs, year 2021, week 49
Read: https://www.topjavablogs.com/news/best-of-49-2021
8 540
Top 10 Free Java Courses for Beginners to Learn Online in 2022 - Best of Lot
Hello guys, the Internet is full of useful resources, and no matter what you want to learn, there is something useful available for free. You just need to commit your time and effort. But at the same...
Read: http://www.java67.com/2018/08/top-10-free-java-courses-for-beginners-experienced-developers.html
8 540
5 Best Spring Framework Courses for Beginners to Learn Online in 2022
Hello Java developers, if you want to learn Spring Framework and looking for the best resources like books, online courses, and tutorials then you have come to the right place. Earlier, I have...
Read: http://www.java67.com/2021/11/5-best-spring-framework-courses-for.html
8 540
5 Essential Features Every Java Developer should learn in 2022
Hello Java programmers, If you are wondering which new Java feature you should learn in 2022 then you have come to the right place. Earlier I have shared Java Developer RoadMap and essential Java...
Read: http://www.java67.com/2021/01/top-5-new-java-features-to-learn-in-2021.html
8 540
Обучитесь Java c нуля или прокачайте свои скиллы под руководством разработчика из Google
Уроки по 10-15 минут проходят в видеоформате, а первые 5 уроков в каждом курсе бесплатные. Сегодня и завтра со скидкой доступны следующие курсы:
— Java Core;
— SQL;
— JDBC;
— HttpServlets;
— Maven;
— JUnit 5;
— Groovy;
— Gradle;
— Hibernate.
Успевайте приобрести их со скидкой 40%: https://dmdev.taplink.ws/
Это #партнёрский пост
8 540
5 Best Free Cloud Computing Courses for Beginners to Join in 2022 [UPDATED]
Hello guys, if you want to learn Cloud computing in 2022 (which is really great!!) and looking for the best free resources like online courses to kick start your Cloud Computing journey, then you...
Read: http://www.java67.com/2020/12/5-free-cloud-computing-courses-for-beginners.html
8 540
Top 5 Free Online Courses to Learn Eclipse and JUnit for Beginners in 2022 - Best of Lot
Both Eclipse and JUnit are two of the essential tools for Java Developers. Eclipse is a Java IDE, Integrated Development environment which allows you to code, run, and debug Java programs from a...
Read: http://www.java67.com/2018/02/5-free-eclipse-and-junit-online-courses-java-developers.html
8 540
Top 5 Free Data Science and Data Analysis Courses for Beginners to Learn Online in 2022 - Best of Lot
Hello folks, Data Science and Data Analysis are two of the most in-demand skills in the current technology world. All kinds of companies need them to improve their sales, profit, and overall business...
Read: http://www.java67.com/2020/08/top-5-free-courses-to-learn-data-science-and-analysis.html
