资源简介
posix linux环境下的pthread source 通过查看源代码可以对线程的认识更加深刻 你知道吗?线程的底层实现也是调用clone[创建进程] 故有线程是轻量级的进程

代码片段和文件信息
/* Copyright (C) 2002-2013 Free Software Foundation Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not see
. */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef NEED_SEPARATE_REGISTER_STACK
/* Most architectures have exactly one stack pointer. Some have more. */
# define STACK_VARIABLES void *stackaddr = NULL
/* How to pass the values to the ‘create_thread‘ function. */
# define STACK_VARIABLES_ARGS stackaddr
/* How to declare function which gets there parameters. */
# define STACK_VARIABLES_PARMS void *stackaddr
/* How to declare allocate_stack. */
# define ALLOCATE_STACK_PARMS void **stack
/* This is how the function is called. We do it this way to allow
other variants of the function to have more parameters. */
# define ALLOCATE_STACK(attr pd) allocate_stack (attr pd &stackaddr)
#else
/* We need two stacks. The kernel will place them but we have to tell
the kernel about the size of the reserved address space. */
# define STACK_VARIABLES void *stackaddr = NULL; size_t stacksize = 0
/* How to pass the values to the ‘create_thread‘ function. */
# define STACK_VARIABLES_ARGS stackaddr stacksize
/* How to declare function which gets there parameters. */
# define STACK_VARIABLES_PARMS void *stackaddr size_t stacksize
/* How to declare allocate_stack. */
# define ALLOCATE_STACK_PARMS void **stack size_t *stacksize
/* This is how the function is called. We do it this way to allow
other variants of the function to have more parameters. */
# define ALLOCATE_STACK(attr pd) \
allocate_stack (attr pd &stackaddr &stacksize)
#endif
/* Default alignment of stack. */
#ifndef STACK_ALIGN
# define STACK_ALIGN __alignof__ (long double)
#endif
/* Default value for minimal stack size after allocating thread
descriptor and guard. */
#ifndef MINIMAL_REST_STACK
# define MINIMAL_REST_STACK 4096
#endif
/* Newer kernels have the MAP_STACK flag to indica
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-14 18:44 nptl\
文件 2545 2013-11-14 16:43 nptl\ANNOUNCE
文件 54 2013-11-14 16:43 nptl\Banner
文件 520054 2013-11-14 16:43 nptl\ChangeLog
文件 982 2013-11-14 16:43 nptl\DESIGN-barrier.txt
文件 2235 2013-11-14 16:43 nptl\DESIGN-condvar.txt
文件 2731 2013-11-14 16:43 nptl\DESIGN-rwlock.txt
文件 835 2013-11-14 16:43 nptl\DESIGN-sem.txt
文件 3981 2013-11-14 16:43 nptl\DESIGN-systemtap-probes.txt
文件 1286 2013-11-14 16:43 nptl\Makeconfig
文件 24675 2013-11-14 16:43 nptl\Makefile
文件 1038 2013-11-14 16:43 nptl\TODO
文件 588 2013-11-14 16:43 nptl\TODO-kernel
文件 295 2013-11-14 16:43 nptl\TODO-testing
文件 8157 2013-11-14 16:43 nptl\Versions
文件 1450 2013-11-14 16:43 nptl\alloca_cutoff.c
文件 36671 2013-11-14 16:43 nptl\allocatestack.c
文件 2946 2013-11-14 16:43 nptl\cancellation.c
文件 1726 2013-11-14 16:43 nptl\cleanup.c
文件 1788 2013-11-14 16:43 nptl\cleanup_compat.c
文件 2950 2013-11-14 16:43 nptl\cleanup_defer.c
文件 3058 2013-11-14 16:43 nptl\cleanup_defer_compat.c
文件 1032 2013-11-14 16:43 nptl\cleanup_routine.c
文件 2153 2013-11-14 16:43 nptl\cond-perf.c
文件 399 2013-11-14 16:43 nptl\configure
文件 13281 2013-11-14 16:43 nptl\descr.h
文件 2179 2013-11-14 16:43 nptl\eintr.c
文件 13 2013-11-14 16:43 nptl\elision-conf.h
文件 31 2013-11-14 16:43 nptl\errno-loc.c
文件 1117 2013-11-14 16:43 nptl\events.c
文件 7923 2013-11-14 16:43 nptl\forward.c
............此处省略928个文件信息
- 上一篇:周传雄专辑,关不上的窗-MTV
- 下一篇:Axure后台业务模型2.0版
相关资源
- pthreads-w32-2-9-1-release.zip
- Source Insight 3.5 配置文件
- SourceCount代码统计
- EhLib v6.0 Full Source.rar
- Multiplicity of Solutions of Weighted (pq)
- Exact Conditions of Blow-up and Global Existen
- Microsoft Windows Services for UNIX 3.5 版中的
- AlphaControls14.23_20190502_Full_Source.rar
- DNF偏移查找工具源码DNF-offset-lookup-t
- SourceInsight 超好用的代码比对工具
- Windows程序设计 中英中文是完美版本
- sourceinsight 4 注册系列号
- Source Navigator(Windows版)
- RM2019机甲大师赛官方赠与步兵代码开
- uniGUI_SourceCode.rar
- 代码复杂度检查工具Source Monitor
- 2019年Ei Compendex收录出版物期刊目录
- 面向对象脑图
- 论文:Stanford Doggo: An Open-Source Quasi-
- HelloWorld2_source_code.zip
- Dynamsoft+SourceAnywhere+for+VSS+5.2+Professio
- FreeRdp源码分析.7z
- source insight4.0免安装
- The Architecture of Open Source Applications 2
- source insight 4.0 仿atom暗色主题
- pthreads-w32-2-9-1-release
- source Insight3.0
-
Remob
jects Hydra for Delphi V3.0.39.777 ful -
Source Insight 4 主题xm
l配置文件仿su - SourceInsight_3.5 中文汉化
评论
共有 条评论