glibc

JVM源码分析之一个Java进程究竟能创建多少线程

扶醉桌前 提交于 2019-12-06 08:29:40
概述 虽然这篇文章的标题打着JVM源码分析的旗号,不过本文不仅仅从JVM源码角度来分析,更多的来自于Linux Kernel的源码分析,今天要说的是JVM里比较常见的一个问题 这个问题可能有几种表述 一个Java进程到底能创建多少线程? 到底有哪些因素决定了能创建多少线程? java.lang.OutOfMemoryError: unable to create new native thread 的异常究竟是怎么回事 不过我这里先声明下可能不能完全百分百将各种因素都理出来,因为毕竟我不是做Linux Kernel开发的,还有不少细节没有注意到的,我将我能分析到的因素和大家分享一下,如果大家在平时工作中还碰到别的因素,欢迎在文章下面留言,让更多人参与进来讨论 从JVM说起 线程大家都熟悉, new Thread().start() 即会创建一个线程,这里我首先指出一点 new Thread() 其实并不会创建一个真正的线程,只有在调用了start方法之后才会创建一个线程,这个大家分析下Java代码就知道了,Thread的构造函数是纯Java代码,start方法会调到一个native方法start0里,而start0其实就是 JVM_StartThread 这个方法 从上面代码里首先要大家关注下最后的那个if判断 if (native_thread->osthread() ==

Is the GNU C Library usable on non-GNU (or POSIX) platforms?

谁说胖子不能爱 提交于 2019-12-06 06:09:46
问题 Just wondering, is the GNU C Library (glibc) usable on non-GNU and/or non-POSIX platforms such as Microsoft Windows? 回答1: Yes, its possible in theory, but not really worth it in practice. You would need to port the syscall interface, dynamic linker, and other parts to Windows or your platform of choice, and Glibc is not an ideal candidate for this. If you really need a self contained C library, I would consider newlib or uClibc (or FreeBSD's/OpenBSD's libc) over glibc. Glibc is a complex

Centos7 静默安装 Oracle11G

空扰寡人 提交于 2019-12-06 06:05:51
1、准备安装包: 安装包下载地址:https://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html 2、先临时关闭 selinux: [root@Centos ~]# setenforce 0 3、安装依赖的软件包: [root@Centos ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686

Non-blocking read on pipe

妖精的绣舞 提交于 2019-12-06 05:45:22
问题 Can one do non-blocking I/O on a pipe? fcntl fails to set O_NONBLOCK. Page 918 of The Linux Programming Interface includes a table 'Semantics of reading n bytes from pipe or FIFO (p)'. This table lists the behaviour of pipes and FIFO's with one column titled O_NONBLOCK enabled? This would imply that you can set the O_NONBLOCK flag on a pipe. Is this correct? The following code fails to set the flag, fcntl(2) does not report an error though. #include <fcntl.h> #include <sys/wait.h> #include

Where is __builtin_va_start defined?

自作多情 提交于 2019-12-06 05:44:01
I'm trying to locate where __builtin_va_start is defined in GCC's source code, and see how it is implemented. (I was looking for where va_start is defined and then found that this macro is defined as __builtin_va_start .) I used cscope -r in GCC 9.1's source code directory to search the definition but haven't found it. Can anyone point where this function is defined? That __builtin_va_start is not defined anywhere . It is a GCC compiler builtin (a bit like sizeof is a compile-time operator). It is an implementation detail related to the <stdarg.h> standard header (provided by the compiler, not

glibc not supported by Cygwin

被刻印的时光 ゝ 提交于 2019-12-06 05:37:11
问题 Cygwin FAQ has the following info for 'Where is glibc?' : Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult. I was surprised and checked out the release packages as i had earlier used it. While i checked the repositories, it appears that glibc was actually indeed part of cygwin until version 2.10. Can anyone tell of the porting difficulty for the subsequent versions of glibc ? 回答1: The

GLIBCXX not found when compiling vtk example under mex

£可爱£侵袭症+ 提交于 2019-12-06 05:19:13
问题 I have been trying to follow this example for compiling vtk in MATLAB using mex, on an Ubuntu 11.10. The mex command I used is as follows: mex -I/usr/include/vtk-5.6 vtk_file.cpp -L/usr/lib/ -lvtkFiltering -lvtkRendering -lvtkCommon After compilation I have a .mexa64 file. However, when I try to run the file I end up with the following error: Invalid MEX-file '/home/bill/Documents/MATLAB/vtk/vtk_file.mexa64': /usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version

CentOS7静默安装Oracle11gR2

落花浮王杯 提交于 2019-12-06 02:47:36
使用最小化的设定安装完CentOS7后,进入安装Oracle步骤前,需要安装几个工具。具体步骤: yum -y install vim --vim编辑器 yum -y install unzip --zip文件的解压工具 yum -y install lrzsz --上传下载工具 yum -y update --升级所有包,系统版本和内核,改变软件设置和系统设置 注:使用yum安装前,先保证系统可访问互联网。如果在系统无法访问的情况下,可以配置yum资源中心为镜像文件或者下载rpm包进行安装。 完成工具的安装之后,准备进入Oracle的安装过程。 第一步: 安装必须的依赖包 yum -y install gcc yum -y install gcc-c++ yum -y install make yum -y install binutils yum -y install compat-libstdc++-33 yum -y install elfutils-libelf yum -y install elfutils-libelf-devel yum -y install elfutils-libelf-devel-static yum -y install glibc yum -y install glibc-common yum -y install glibc-devel

Why does glibc “timezone” global not agree with system time on DST?

你离开我真会死。 提交于 2019-12-06 02:07:37
问题 I'm experiencing a bizarre issue where my system clock knows that it's daylight savings time, but glibc seems not to. This is an up-to-date Ubuntu installation, and I have checked /etc/localtime and it has the correct changeover time for last week's switch to DST. The current correct timezone for me is Pacific Daylight Time (UTC-7). When I ask my system what time zone I'm in, it tells me correctly: $ date +%z -0700 But when I run the following program: #include <time.h> #include <stdio.h> int

安装Redis3.0

走远了吗. 提交于 2019-12-06 02:07:36
## 安装redis依赖 yum -y install cpp binutils glibc glibc-kernheaders glibc-common glibc-devel gcc make gcc-c++ libstdc++-devel tcl mkdir -p /usr/local/src/redis cd /usr/local/src/redis wget http://download.redis.io/releases/redis-3.0.2.tar.gz 或者 rz 上传 tar -xvf redis-3.0.2.tar.gz cd redis-3.0.2 make -j 4 使用4个cpu编译 make test #这个就不要执行了,需要很长时间 make install cp redis.conf /etc/ vi /etc/redis.conf # 修改如下,默认为no daemonize yes #启动 redis-server /etc/redis.conf #测试 redis-cli ## 工具 utils/install_server.sh 来源: https://www.cnblogs.com/fubinhnust/p/11956115.html