ps&CPU
void f();
int main() {
f();
return 0;
}
void f() {
int i=0;
//volatile int i=0;
while (i<100) { i=10; }
}
root 825 96.5 0.0 2460 724 pts/2 R+ 11:33 0:03 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 95.6 0.0 2460 724 pts/2 R+ 11:33 0:04 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 93.0 0.0 2460 724 pts/2 R+ 11:33 0:05 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 107 0.0 2460 724 pts/2 R+ 11:33 0:06 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 100 0.0 2460 724 pts/2 R+ 11:33 0:07 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 96.2 0.0 2460 724 pts/2 R+ 11:33 0:07 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 104 0.0 2460 724 pts/2 R+ 11:33 0:08 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 99.5 0.0 2460 724 pts/2 R+ 11:33 0:08 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 97.0 0.0 2460 724 pts/2 R+ 11:33 0:09 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 103 0.0 2460 724 pts/2 R+ 11:33 0:10 ./xxx
root@x:~# ps aux|grep xxx|grep -v grep
root 825 102 0.0 2460 724 pts/2 R+ 11:33 0:11 ./xxx
void f();
int main() {
f();
return 0;
}
void f() {
//int i=0;
volatile int i=0;
while (i<100) {
++i; i=10;
}
}
阅读(715) | 评论(0) | 转发(0) |
-->
ps&CPU的更多相关文章
- ps 和 top 的cpu的区别
cpu的计算 ps cpu的定义 man page中给出的定义: cpu utilization of the process in "##.#" format. Currentl ...
- Linux如何统计进程的CPU利用率
1.0 概述 在Linux的/proc文件系统,可以看到自启动时候开始,所有CPU消耗的时间片:对于个进程,也可以看到进程消耗的时间片.这是一个累计值,可以"非阻塞"的输出.获得一 ...
- Linux如何统计进程的CPU利用率[转]
0. 为什么写这篇博客 Linux的top或者ps都可以查看进程的cpu利用率,那为什么还需要了解这个细节呢.编写这篇文章呢有如下三个原因: * 希望在脚本中,能够以过”非阻塞”的方式获取进程cpu利 ...
- 学习笔记TF041:分布式并行
TensorFlow分布式并行基于gRPC通信框架,一个master负责创建Session,多个worker负责执行计算图任务. 先创建TensorFlow Cluster对象,包含一组task(每个 ...
- 学习笔记TF061:分布式TensorFlow,分布式原理、最佳实践
分布式TensorFlow由高性能gRPC库底层技术支持.Martin Abadi.Ashish Agarwal.Paul Barham论文<TensorFlow:Large-Scale Mac ...
- Linux下系统如何监控服务器硬件、操作系统、应用服务和业务
1.Linux监控概述 Linux服务器要保证系统的高可用性,需要实时了解到服务器的硬件.操作系统.应用服务等的运行状况,各项性能指标是否正常,需要使用各种LINUX命令.做到自动化运维就 ...
- 『TensorFlow』分布式训练_其三_多机分布式
本节中的代码大量使用『TensorFlow』分布式训练_其一_逻辑梳理中介绍的概念,是成熟的多机分布式训练样例 一.基本概念 Cluster.Job.task概念:三者可以简单的看成是层次关系,tas ...
- UNIX和Linux信号
1 ~ 31的信号为传统UNIX支持的信号,是不可靠信号(非实时的),编号为32 ~ 63的信号是后来扩充的,称做可靠信号(实时信号).不可靠信号和可靠信号的区别在于前者不支持排队,可能会造成信号丢失 ...
- 进程&进程池
进程 服务器中, s.listen(n) n不能无限大,以为内存不可能无限大,n表示内存同一时间接纳的等待连接数,可以看成一个(队列),取出一个拿去建立连接,然后再放进一个,队列中一直保持n个连接 请 ...
随机推荐
- SpringCloud之Eureka高可用集群环境搭建
注册中心集群 在微服务中,注册中心非常核心,可以实现服务治理,如果一旦注册出现故障的时候,可能会导致整个微服务无法访问,在这时候就需要对注册中心实现高可用集群模式. Eureka集群相当简单:相互注册 ...
- EntityFramework 学习 一 Add New Entity using DBContext in Disconnected Scenario
using System; using System.Collections.Generic; public partial class Student { public Student() { th ...
- 日期工具类 DateUtils(继承org.apache.commons.lang.time.DateUtils类)
/** * */ package com.dsj.gdbd.utils.web; import org.apache.commons.lang3.time.DateFormatUtils; impor ...
- Android退出应用最优雅的方式(改进版)
Android退出应用最优雅的方式(改进版)(转) 我们先来看看几种常见的退出方法(不优雅的方式) 一.容器式 建立一个全局容器,把所有的Activity存储起来,退出时循环遍历finish所有Act ...
- C#实现文件拖放并打开文件(使用ListBox)
1.C#实现文件拖放并打开文件 (http://www.cnblogs.com/GaoHuhu/archive/2012/10/10/2717954.html)
- stl_slist.h
stl_slist.h // Filename: stl_slist.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com // Blog: http:/ ...
- 1103 Integer Factorization (30)(30 分)
The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positi ...
- Python Class 的实例方法/类方法/静态方法
实例方法.类方法.静态方法 class MyClass(object): class_name = "MyClass" # 类属性, 三种方法都能调用 def __init__(s ...
- [转]PNG8和PNG24的区别
首先我们要知道: 1.png8和png24的根本区别,不是颜色位的区别,而是存储方式不同. 2.png8有1位的布尔透明通道(要么完全透明,要么完全不透明),png24则有8位(256阶)的布尔透明通 ...
- 51nod 1450 闯关游戏——期望dp
题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1450 想了半天,不知道不能走的状态(即最后不足m个的状态)怎么办. ...