Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of concurrent execution in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the example analysis of concurrent execution in Linux, which is very detailed and has certain reference value. Friends who are interested must finish it!

The concurrency function of

Time for i in `grep server / etc/hosts | awk'{print $1}'`; do (ssh $I "echo 123; sleep 1; echo 456" &); donereal 0m0.063suser 0m0.016ssys 0m0.004s

Concurrency function of xargs

Time grep server / etc/hosts | awk'{print $1}'| xargs-P 24-I {} ssh {} "echo 123; sleep 1; echo 456" real 0m3.747suser 0m1.136ssys 0m0.112s

Concurrency is actually very simple, do not need dozens of lines of golang or python code, do not need the installation environment, compilation and other tedious steps, just get back to simplicity.

The above is all the content of the article "sample Analysis of concurrent execution in Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report