- 授权协议: LGPL
- 开发语言: C/C++
- 操作系统: Linux
- 软件首页: http://www.softndesign.org/codes/c/debug/libchildcontrol.html
软件介绍
LibChildControl 能创建一个线程来管理子进程,并且在失败的时候重启他们。
使用示例:
int child_process (void *data)
{
int id = *(int *)data;
int delay = (id + 1) * 1000;
printf ("TEST: Start child %d.\n", id);
int i;
for (i = 0; i < nb_loops; i++) {
printf ("TEST: Child %d is working (loop %d/%d)\n", id, i + 1, nb_loops);
int j;
float r = 0;
for (j = 0; j < 100 * id; j++) {
float x = 0;
do
x = (float) rand () / ((float)RAND_MAX + 1);
while (x == 0);
float y = (float) rand () / ((float)RAND_MAX + 1);
float z = sqrtf (-2. * logf (x)) * cosf (2 * M_PI * y);
r += z * (1 << 31);
usleep (1000);
}
}
kill (getpid (), SIGTERM);
return 0;
}
int child_term (void *data)
{
int id = *(int *)data;
printf ("TEST: Child %d is dieing.\n", id);
return 0;
}
#define nb_children 2
#define nb_loops 10
int main (int argc, char *argv[])
{
int d[nb_children];
int i;
for (i = 0; i < nb_children; i++) {
d[i] = i + 1;
register_child (i + 1, NULL, NULL, child_process, child_term, (void *)(d + i));
}
sleep (100);
return 0;
}
HotSpot实战
陈涛 / 人民邮电出版社 / 2014-3 / 69
《HotSpot实战》深入浅出地讲解了HotSpot虚拟机的工作原理,将隐藏在它内部的本质内容逐一呈现在读者面前,包括OpenJDK与HotSpot项目、编译和调试HotSpot的方法、HotSpot内核结构、Launcher、OOP-Klass对象表示系统、链接、运行时数据区、方法区、常量池和常量池Cache、Perf Data、Crash分析方法、转储分析方法、垃圾收集器的设计演进、CMS和G......一起来看看 《HotSpot实战》 这本书的介绍吧!
