zoukankan      html  css  js  c++  java
  • 多进程和单进程区别

    [root@node01 0413]# time perl a2.pl
    
    real	2m57.885s
    user	0m0.497s
    sys	0m0.093s
    [root@node01 0413]# ls -ltr
    total 1456
    -rw-r--r-- 1 root root   1927 Feb 26 07:18 a1.pl
    -rw-r--r-- 1 root root   1695 Feb 26 07:20 a2.pl
    -rw-r--r-- 1 root root 102655 Feb 26 07:23 1.txt
    -rw-r--r-- 1 root root 100631 Feb 26 07:23 2.txt
    -rw-r--r-- 1 root root 101847 Feb 26 07:24 3.txt
    -rw-r--r-- 1 root root 100288 Feb 26 07:24 5.txt
    -rw-r--r-- 1 root root 101228 Feb 26 07:24 6.txt
    -rw-r--r-- 1 root root 101605 Feb 26 07:24 7.txt
    -rw-r--r-- 1 root root 101919 Feb 26 07:25 8.txt
    -rw-r--r-- 1 root root 101897 Feb 26 07:25 9.txt
    -rw-r--r-- 1 root root 101749 Feb 26 07:25 10.txt
    -rw-r--r-- 1 root root 102083 Feb 26 07:25 11.txt
    -rw-r--r-- 1 root root 102381 Feb 26 07:25 12.txt
    -rw-r--r-- 1 root root  89726 Feb 26 07:26 13.txt
    -rw-r--r-- 1 root root 119149 Feb 26 07:26 14.txt
    -rw-r--r-- 1 root root 137142 Feb 26 07:26 15.txt
    
    [root@node01 0413]# sum *.txt
    54507   100 10.txt
    38754   100 11.txt
    62332   100 12.txt
    42359    88 13.txt
    12490   117 14.txt
    10142   134 15.txt
    44426   101 1.txt
    09497    99 2.txt
    46261   100 3.txt
    41958    98 5.txt
    51718    99 6.txt
    46311   100 7.txt
    41012   100 8.txt
    46713   100 9.txt
    
    
    
    [root@node01 0413]# time perl a1.pl
    $c====Parallel::ForkManager
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/2757485/1 1.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/2757485/2 2.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/3 7.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/1 5.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/2 6.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/5 9.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/9 13.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/6 10.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/8 12.txt
    $linkarray=== http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4252654&pid=24595811&page=1 15.txt
    $linkarray=== https://blog.csdn.net/zhaoyangjian724/article/details/77947115 14.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/4 8.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/1756685/7 11.txt
    $linkarray=== http://blog.csdn.net/zhaoyangjian724/article/category/2757485/3 3.txt
    
    real	0m21.153s
    user	0m2.865s
    sys	0m0.497s
    [root@node01 0413]# sum *.txt
    58496   100 10.txt
    14553   100 11.txt
    64454   100 12.txt
    38268    88 13.txt
    17959   117 14.txt
    17083   134 15.txt
    54946   101 1.txt
    24405    99 2.txt
    32552   100 3.txt
    40290    98 5.txt
    30174    99 6.txt
    10822   100 7.txt
    06389   100 8.txt
    45862   100 9.txt

  • 相关阅读:
    Linux Systemcall By INT 0x80、Llinux Kernel Debug Based On Sourcecode
    ELF(Executable and Linkable Format)
    Linux文件权限;ACL;Setuid、Setgid、Stick bit特殊权限;sudo提权
    Linux System Calls Hooking Method Summary
    GCC、Makefile编程学习
    Linux Process/Thread Creation、Linux Process Principle、sys_fork、sys_execve、glibc fork/execve api sourcecode
    Linux中断技术、门描述符、IDT(中断描述符表)、异常控制技术总结归类
    浅议SNMP安全、SNMP协议、网络管理学习
    DNS安全浅议、域名A记录(ANAME),MX记录,CNAME记录
    RIP、OSPF、BGP、动态路由选路协议、自治域AS
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349241.html
Copyright © 2011-2022 走看看