We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Category: Linux System Programming

Process Identification in Linux – Tutorial & Example

In this article we will discuss, how to differentiate and identify each process in linux. Process ID Each process in Linux has a unique id and has a parent.  We can get the process id of a running process and its parent’s process id using following functions, Advertisements pid_t getpid() pid_t getppid() File to be …

Process Identification in Linux – Tutorial & ExampleRead More

Creating a new process using fork() System call

fork() System Call

In this article we will discuss how to create a new process using fork() system call. fork() System Call A Process can create a new child process using fork() system call. Advertisements This new child process created through fork() call will have same memory image as of parent process i.e. it will be duplicate of …

Creating a new process using fork() System callRead More

C++ : How to pass class member function to pthread_create() ?

POSIX Library provides a function pthread_create() to create threads i.e. #include <pthread.h> int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); It accepts a function pointer as startup routine. This function accepts void * as argument and returns void *. In previous article we discussed how to use this API with global functions …

C++ : How to pass class member function to pthread_create() ?Read More

POSIX : How to create a thread | pthread_create() example & Tutorial

In this article we will discuss how to create a thread in C or C++ using POSIX Thread Library on Linux. Creating a thread will create a separate execution unit with in the same process. Each thread will have its own, Advertisements Stack Thread ID Program counter Thread Local Storage Each of thread shares the …

POSIX : How to create a thread | pthread_create() example & TutorialRead More

POSIX : How to get thread Id of a pthread in Linux | pthread_self() | pthread_equals()

In this article we will discuss how to get thread id of a pthread and compare different thread ids. How to get thread id of current thread Use pthread_self() to get the current thread id i.e. Advertisements #include <pthread.h> pthread_t pthread_self(void); It returns the thread id as pthread_t object for the calling thread. As main function is …

POSIX : How to get thread Id of a pthread in Linux | pthread_self() | pthread_equals()Read More

POSIX : Detached vs Joinable threads | pthread_join() & pthread_detach() examples

With every thread some resources are associated like stack and thread local storage etc.  When a thread exits ideally these resources should be reclaimed by process automatically. But that doesn’t happens always. It depends on which mode thread is running. A Thread can run in two modes i.e. Joinable Mode Detached Mode Joinable Thread & pthread_join() …

POSIX : Detached vs Joinable threads | pthread_join() & pthread_detach() examplesRead More

Cart

Your Cart is Empty

Back To Shop