Thread implementation in Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Thread implementation in Linux
# 1  
Old 04-13-2013
Thread implementation in Linux

I read about Thread implementation in linux. it says a thread is treated as a process. that means every thread (which should be light weight) has it's own task_struct (which is quite heavy, tipically 1.5kb). still results favors linux then other operating system which have additional support for Threads. Does any one have explanation how Linux is favorable?Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Linux

Thread specific data from linux core dump

How do i get pointer to thread's local storage or thread specific data while analyzing core dump for linux ? i use pthread_setspecific to store some data in the pthread's local stoare. my multi threaded program on linux crashed, and i want to see what is stored in current running thread's... (2 Replies)
Discussion started by: vishwasungal
2 Replies

2. Linux

Linux Thread Stack Size pthread_attr_setstacksize

I have MultiThreaded Application in Linux. I am Setting the stack size using pthread_attr_setstacksize. The stack size i set is greter than PTHREAD_STACK_MIN i.e. 16384 bytes for my system. i am setting the stack size to 17408 bytes, and my application crashes due to insufficient stack size.... (1 Reply)
Discussion started by: Kedar Sabnis
1 Replies

3. UNIX for Dummies Questions & Answers

Linux Device Driver: how can an ISR wake up a user-thread?

Hi all, Is it possible to do the following in Linux (kernel 2.6.x): - A user-space thread goes to "sleep". Using any call/mechanism - On a hardware generated interrupt, the Interrupt handler (ISR) "wakes" the sleeping user-thread. I have seen wait_event() and wake_up() but it appears... (1 Reply)
Discussion started by: agaurav
1 Replies

4. Infrastructure Monitoring

Need implementation of TCP, SNMP and WIMAX in Linux

Hi, Can anyone please provide the Open Source implmentation of the Following Protocols in Linux Operating Systems. A. SNMP B. TCP C. WIMAX MAC layer protocol. Thaniks Saurav (2 Replies)
Discussion started by: sauravbh
2 Replies

5. Programming

Thread pooling in cpp on gnu linux

I m newb to thread pooling. I have to create a cpp application using thread pooling for gnu/linux machine. I didn't get too much on the net. Can any one give me the references to source code or conceptual document of thread pooling in cpp for gnu/linux. Any help will be appreciated. (4 Replies)
Discussion started by: ps_sach
4 Replies

6. Linux

usel level TCP implementation for linux

Does anyone know of a user level implementation of the TCP stack for Linux? Thanks, - sumati (1 Reply)
Discussion started by: sumati01
1 Replies

7. Programming

Frame buffer implementation in Linux

At present, Iam working on Linux Framebuffer device console. I have a doubt sir. Please solve this. *How to display a string or a character in Frame buffer in C language? *What is the library file (is it <linux/fb.h> or other one?) used to do all I/O function manipulations like printing,... (0 Replies)
Discussion started by: chandra80
0 Replies

8. Linux

Linux Hyper-thread support?

Hello all, I'm looking in to building a Redhat/Windows machine for myself and was wondering if Redhat linux support 800Mhz front side bus speed or hyper-thread? If so would I have to recompile the kernel to enable this feature? Thanks (3 Replies)
Discussion started by: larry
3 Replies
Login or Register to Ask a Question
PTHREAD_SELF(3) 					     Linux Programmer's Manual						   PTHREAD_SELF(3)

NAME
pthread_self - obtain ID of the calling thread SYNOPSIS
#include <pthread.h> pthread_t pthread_self(void); Compile and link with -pthread. DESCRIPTION
The pthread_self() function returns the ID of the calling thread. This is the same value that is returned in *thread in the pthread_cre- ate(3) call that created this thread. RETURN VALUE
This function always succeeds, returning the calling thread's ID. ERRORS
This function always succeeds. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +---------------+---------------+---------+ |Interface | Attribute | Value | +---------------+---------------+---------+ |pthread_self() | Thread safety | MT-Safe | +---------------+---------------+---------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008. NOTES
POSIX.1 allows an implementation wide freedom in choosing the type used to represent a thread ID; for example, representation using either an arithmetic type or a structure is permitted. Therefore, variables of type pthread_t can't portably be compared using the C equality operator (==); use pthread_equal(3) instead. Thread identifiers should be considered opaque: any attempt to use a thread ID other than in pthreads calls is nonportable and can lead to unspecified results. Thread IDs are guaranteed to be unique only within a process. A thread ID may be reused after a terminated thread has been joined, or a detached thread has terminated. The thread ID returned by pthread_self() is not the same thing as the kernel thread ID returned by a call to gettid(2). SEE ALSO
pthread_create(3), pthread_equal(3), pthreads(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 PTHREAD_SELF(3)