Structured Concurrency to Simplify Java Multithreaded Programming

JEP 428, Structured Concurrency (Incubator), has been promoted from Proposed to Target to Targeted status for JDK 19. Under the umbrella of Project Loom, this JEP proposes simplifying multithreaded programming by introducing a library to treat multiple tasks running on different threads as an atomic operation. As a result, it will streamline error handling and cancellation, improve reliability, and enhance observability. This is still an incubating API.

This allows developers to organize their concurrency code using the StructuredTaskScope class. It will treat a family of subtasks as a unit. The subtasks will be created on their own threads by forking them individually but then joined as a unit and possibly canceled as a unit; their exceptions or successful results will be aggregated and handled by the parent task. Let’s see an example:


Response handle() throws ExecutionException, InterruptedException 
   try (var scope = new StructuredTaskScope.ShutdownOnFailure()) 
       Future<String> user = scope.fork(() -> findUser());
       Future<Integer> order = scope.fork(() -> fetchOrder());

       scope.join();          // Join both forks
       scope.throwIfFailed(); // ... and propagate errors

       // Here, both forks have succeeded, so compose their results
       return new Response(user.resultNow(), order.resultNow());
   


The above handle() method represents a task in a server application. It handles an incoming request by creating two subtasks. Like ExecutorService.submit(), StructuredTaskScope.fork() takes a Callable and returns a Future. Unlike ExecutorServicethe returned Future is not joined via Future.get(). This API runs on top of JEP 425, Virtual Threads (Preview), also targeted for JDK 19.

The examples above use the StructuredTaskScope API, so to run them on JDK 19, a developer must add the jdk.incubator.concurrent module, as well as enable preview features to use virtual threads:

Compile the above code as shown in the following command:

javac --release 19 --enable-preview --add-modules jdk.incubator.concurrent Main.java

The same flag is also required to run the program:

java --enable-preview --add-modules jdk.incubator.concurrent Main;

However, one can directly run this using the source code launcher. In that case, the command line would be:

java --source 19 --enable-preview --add-modules jdk.incubator.concurrent Main.java

The jshell option is also available, but requires enabling the preview feature as well:

jshell --enable-preview --add-modules jdk.incubator.concurrent

The benefits structured concurrency brings are numerous. It creates a child-parent relationship between the invoker method and its subtasks. For instance, from the example above, the handle() task is a parent and its subtasks, findUser() and fetchOrder(), are children. As a result, the whole block of code becomes atomic. It ensures observability by demonstrating the task hierarchy in the thread dump. It also enables short-circuiting in error handling. If one of the sub-tasks fails, the other tasks will be canceled if not completed. If the parent task’s thread is interrupted before or during the call to join(), both forks will be automatically canceled when the scope exits. These bring clarity to the structure of the concurrent code, and the developer can now reason and follow the code as if they read through as if they are running in a single-threaded environment.

In the early

Read More

USM Graphic Design Student Wins Award at National ADDYs

Tue, 06/07/2022 – 16:54pm | By: Ivonne Kawas

Sydney BeechA former graphic design student in The University of Southern Mississippi’s (USM) Art and Design program, housed in the School of Performing and Visual Arts, was honored at one of the advertising industry’s largest creative competitions — the National American Advertising Federation ADDY Awards — at a Gala and Celebration held recently in Nashville, Tenn.

Sydney Beech, a recent Bachelor of Fine Arts in Graphic Design graduate and native of Ellisville, Miss., won a gold ADDY in the Out-of-Home and Ambient Media: Poster Campaign category for her “St. Pete Conservation Festival” poster set.

“This was a great year for the graphic design program and our students,” said Jacob Cotton, associate professor in the Art and Design program. “They’ve won countless awards at the national level and have been featured in numerous national publications for their work. These awards help to show potential employers the caliber work our students are capable of and they help our students to see where their hard work can take them.”

“Every year our student’s work is well represented at the National ADDYs competition having made it through district level to reach this stage of the competition,” Cotton added. “But this is only the second time in USM history that one of our students has won a National ADDY. Beech is well-deserving of this award as she is one of our very best students — her work ethic and ability to grow during this pandemic is unmatched and we’re extremely proud of her.”

Beech shared how she felt about representing USM at the competition and thanked everyone in the Southern Miss Art and Design program for positively influencing her development through ongoing support.

“It was such an honor to be able to represent USM at Nationals this year and bringing home a gold award was quite a pleasant surprise,” she said. “This is an opportunity that only a small number of students in the country get to experience and I could not be more grateful!”

“I am also thankful for the support I have received from the Art and Design program,” she added. “For me, this award not only represents my hard work, but also the hard work and passion of all the people behind the program. Southern Miss made a huge impact on my life and winning this award was a wonderful way for me to close out my time as a student.”

Some of her award-winning workSome of her award-winning pieces

For this project, Beech was tasked with developing a brand, style guide, and collateral for a conference or event of choice. The location selected from a list served as the primary inspiration for her brand. It was important that the brand and theme be in context to the subject of the conference and the area and history of the chosen location. Beech selected St. Petersburg, Fla. for her project and created the St. Pete Conservation Festival, a two-day festival all about ocean conservation geared towards teens to educate them on the issue in an

Read More

Crypto platform tells savers how it’s different from Celsius Network

A crypto platform is stressing that it has a completely different business model than the embattled Celsius Network — and strives to make its users’ money work for them in a sustainable way.

In a live ask-me-anything session on Cointelegraph’s YouTube channel, YouHodler CEO Ilya Volkov said the interest rates offered through his company are sustainable — and unlike others in the space, the exchange isn’t exposed to third-party risk.

Volkov said YouHodler is “self-sufficient” and hasn’t been backed by an initial coin offering or venture capitalists, with customer funds never placed under someone else’s management.

Explaining how the trading platform can afford to offer interest rates that beat banks, the CEO explained it shares a “significant part” of its revenues with users — and when asked about the current bear market, described crisis as a time of opportunity.

“It’s a nice time to prove that everything is up and running, we have a sustainable business model, we have proper risk management,” Volkov said.

Illustrating how this works in practice, the CEO pointed to how the current climate had prompted YouHodler to reduce the maximum amount that each user could earn interest on — from $100,000 to $25,000 — with the prospect this could increase in future.

And on the topic of sustainability, he stressed that YouHodler has no connections to other DeFi protocols — something that has led to serious headaches for a number of rivals.

The future

Volkov acknowledged that the crypto winter is hard for many, but pointed to the fact that other asset classes are also struggling as high inflation and key rate hikes from the US Federal Reserve contributed to “a lot of panicking on the market” — with fears growing that a recession might be on the horizon.

He explained that YouHodler offers products for passive and active crypto investors alike — catering to those who simply want to buy or swap digital assets, people who want cash to pay bills without selling off their crypto, and advanced traders who intend to use lending for leverage .

Giving his vision of building a bridge between DeFi and CeFi, YouHodler’s CEO was confident that the future is bright for the industry.

“We all witnessed a transition from private storage to cloud storage. Now, we are 99% cloud-based. I believe that, in a few years from now, we will all be blockchain based in terms of storage of data, in terms of digital identities,” Volkov said.

He went on to reveal that YouHodler’s very first DeFi product is slated to launch in July — and that it’ll be easy to use with no staking or pooling that’s linked to third parties.

More insights from you handler here

Not your keys, not your crypto?

A common refrain with crypto wallets and lending platforms relates to an old saying from Bitcoiners: “Not your keys, not your crypto.”

While Volkov is a firm believer in hardware wallets and uses one personally, he believes that companies like YouHodler can and

Read More

IIT Madras is inviting applications from students for BSc in Programming and Data Science

  • Students can do this full time or along with an on-campus degree.
  • Open to working professionals and those taking a career break.

Manama: Indian Institute of Technology Madras (IIT Madras), ranked No.1 in India Rankings 2021 by NIRF, is inviting applications from the students of Bahrain to apply for the world’s first BSc Degree in Programming and Data Science.

Anyone who is currently in Class XII and studied English and Math in Class X, can apply for the qualifier exam. Students in class XII can gain admission now and join the program after completing their class XII. The classes for the next qualifier batch will commence in September 2022.

The last date to apply for the September Term of this Data Science Program is 19 August 2022. Interested students can apply through the website – https://onlinedegree.iitm.ac.in.

Data Science is one of the fastest growing sectors that is predicted to create 11.5 million jobs by 2026. This unique program will be offered in three different stages; Foundational Level, Diploma level, Degree level. Applicants are invited irrespective of their geographic location, academic background, and profession.

“The BSc Program in Programming and Data Science is an interactive program to underline the fact that IIT is within the reach of everyone. Unlike any other selection exam, the BSc Program has a qualifying exam. Data Science is a growing field and for at least 15 to 20 years there will be no dearth of jobs. We are planning to make IIT Madras a ‘Vishwa-guru (Global Teacher)’ through visionary approaches to enhance the quality of education. IIT Madras’ BSc program is meticulously drafted to align the goals of the National Educational Policy.” says, Prof. V Kamakoti, Director, IIT Madras.

More than 60,000 applications have been received for the BSc qualifier process so far and currently, more than 12,500 students from various countries are pursuing the BSc program. The diversity of the learners in the program in terms of student age (18-76 yrs), role (students from different educational backgrounds – commerce, arts, science, engineering, management, medicine and law, among others, working professionals from different industries sectors) and learners being from more than 25 countries is one of the highlights of the program.

The program is highly flexible keeping the convenience of the learner in mind, where weekly content is released on a portal for anytime access, while all examinations have to be attended in person at designated centers in Bahrain, which ensures credibility of the learning assessment. The application process includes four weeks of training, which includes video lectures, weekly assignments, discussion forums and live interactions with professors and course instructors. Applicants have to write the qualifier examination in person which is based only on these 4 weeks of content and if they get more than the minimum cutoff, they can join the foundation level of the BSc in Programming and Data Science. The qualifier exam can be written at the exam centers in Bahrain IIT Madras is working with Laurels Center for Global Education to conduct

Read More

Extreme Networks (EXTR) Moves 6.1% Higher: Will This Strength Last?

Extreme Networks (EXTR) shares ended the last trading session 6.1% higher at $9.58. The jump came on an impressive volume with a higher-than-average number of shares changing hands in the session. This compares to the stock’s 6% loss over the past four weeks.

Extreme Networks has launched a suite of new solutions and extended its ExtremeCloud portfolio to include new SD-WAN and AIOps with digital twin capabilities. This, in turn, will deliver secure connectivity at the edge of the network, accelerate cloud deployments and help customers with actionable insights – all from within a single platform. This will simplify network management, augment security and improve application performance with a simple, cost-effective subscription licensing model.

This maker of network infrastructure equipment is expected to post quarterly earnings of $0.15 per share in its upcoming report, which represents a year-over-year change of -21.1%. Revenues are expected to be $270.5 million, down 2.7% from the year-ago quarter.

Earnings and revenue growth expectations certainly give a good sense of the potential strength in a stock, but empirical research shows that trends in earnings estimate revisions are strongly correlated with near-term stock price movements.

For Extreme Networks, the consensus EPS estimate for the quarter has remained unchanged over the last 30 days. And a stock’s price usually doesn’t keep moving higher in the absence of any trend in earnings estimate revisions. So, make sure to keep an eye on EXTR going forward to see if this recent jump can turn into more strength down the road.

The stock currently carries a Zacks Rank #3 (Hold). You can see the complete list of today’s Zacks Rank #1 (Strong Buy) stocks here

Extreme Networks is part of the Zacks Computer – Networking industry. Digi International (DGII), another stock in the same industry, closed the last trading session 4.5% higher at $24.12. DGII has returned 5.1% in the past month.

For Digi International , the consensus EPS estimate for the upcoming report has remained unchanged over the past month at $0.38. This represents a change of +322.2% from what the company reported a year ago. Digi International currently has a Zacks Rank of #4 (Sell).

Want the latest recommendations from Zacks Investment Research? Today, you can download 7 Best Stocks for the Next 30 Days. Click to get this free report

To read this article on Zacks.com click here.

Zacks Investment Research

Read More