This site works best with JavaScript enabled
Sign In
Discussions
Activity
Sign In
27.Threads Attributes
A program if consists of few threads & they are in sequence , it is pretty much apparent that some will execute faster as compared to others. If this happens and not in the order of sequence then threads may block themselves waiting for data t…
by
nirmalpg124
May 2023
003 Linux System Programming
permalink
WAP to synchronize data among three processes using shared memory
Relevant code is for process C
while(running) { while((shared_stuff->A_flag ==0 && shared_stuff->B_flag == 1 && shared_stuff->C_flag == 0 ) || (shared_stuff->A_flag ==0 && shared_stuff-…
by
nirmalpg124
March 2023
Pravjot Sir Classes
permalink
WAP to synchronize data among three processes using shared memory
Following code is for process B
#include#include#include#include#include#include "../shmreader/shm_com.h"
int main(){ int running = 1; void *shared_memory = (void *)0; struct shared_use_st *shared_stuff; char buffer[BUFSIZ]; int sh…
by
nirmalpg124
March 2023
Pravjot Sir Classes
permalink
WAP to synchronize data among three processes using shared memory
sorry server not accepting long codes for the time being
relevant code for process A
while(running) { while((shared_stuff->A_flag == 0 && shared_stuff->B_flag == 1 && shared_stuff->C_flag == 0) || …
by
nirmalpg124
March 2023
Pravjot Sir Classes
permalink
malloc and the fork
I was executing a code given in the notes, but I thinke there's some more to add into it:-define _GNU_SOURCE
#include
#include
#include
#include
#include
#define CHILD 1
#define PARENT 2
#define WORK_ON_MEM(PROCESS, loc, g)
do
{
if(…
by
gaurav133232
March 2023
Pravjot Sir Classes
permalink
06-07-08-Process-Management-Replacement
/** * file : test.c * author : deepak_jangra * created : 2021 Apr 13 01:06:25 IST * lastMod : Tuesday 13 April 2021 01:06:25 PM IST **/
#include #include #include #include
int main(int argc , char *argv[]){ int n; …
by
deepak4u106
April 2021
003 Linux System Programming
permalink
Session 15, 16, 17, 18, 19.Advanced Signals Handlers
Don't use sleep() instead use nonosleep()
#include int nanosleep(const struct timespec *req, sruct timespec *rem);struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */};
by
spatlou
September 2020
303 Linux System Programming
permalink
Simple Alarm Program
Sample code for Simple Alarm Here you can set timings for a Alarm [ just for fun ] you will hear a ringtone, here is the code for that
#include"headers,h" // include , , , void make_char(int);int i=0;char p[9];int main(){ tim…
by
surajk1164
August 2018
Pravjot Sir Classes
permalink
Introduction to C programming
what is the difference between "SIGINT" and "SIGKILL" when using it with 'kill' system call ?#include#include#include#include#include#include
void HANDLER(int);
int main(){
printf("%s:Begin.\n",__F…
by
keshavmehta15
May 2018
001 C Programming, Data Structures
permalink
Reading by Pipe in Server
While i am reading in Server add result , i am getting garbage value.
Please let me know where i am doing wrong.
#include
#include
#include
#include
#include
#include
#include
struct Operation
{
int num1;
int num2;
char o…
by
yogesh.singh
January 2018
Pravjot Sir Classes
permalink
Linux System Administration
systemctl hibernate giving error:Failed to hibernate system via logind: Sleep verb not supported
by
kartik.gupta
January 2018
Query
permalink
B97 : Device Driver Development
Synchronisation in Device Drivers(Spinlock)
It is non interruptible,non preemptible and atomic synchronization mechanism.Used in code which cannot sleep.Used when you dont want to let your quantum go to the scheduler too.These are better than semap…
by
saurabh.hmr009
August 2017
Pravjot Sir Classes
permalink
Client Server Application using IPC and Synchronization techniques.
Basic things regarding clients-server using circular buffers :
Never use sleep in your project, its not practical enough to give a delay intentionally when you want to run mealtime things
In order to have a proper synchronization between variou…
by
sankalpnegi2310
June 2017
003 Linux System Programming
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
Implementing dual binary semaphore array [-ISSUES-]
The single binary semaphore worked quite well the last time (mentioned in above posts), so trying with a dual binary semaphore array.Issues encountered:When 2 binary semaphores are being impleme…
by
sankalpnegi2310
June 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
Zombie State Demonstration
Zombie or Defunct state (Z+) is a state when child execution is completed but parent couldn't terminate it immediately as Parent process is busy executing its own statement. Till the time Parent reaches child termina…
by
vishwajeet.gaur1989
May 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
Code Demonstration==> For wait System Call..RCS.1.1date 2017.05.24.15.50.41; author vishwajeet; state Exp;branches;next ;desc@To demonstrate the use of Wait in case the child process becomes orphan.#include#include#include#includeint main(){ int…
by
vishwajeet.gaur1989
May 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
-- > wait() System Call
by
vishwajeet.gaur1989
May 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
Process 2
head 1.1;
access;
symbols;
locks; strict;
comment @ * @;
1.1
date 2017.05.26.13.20.32; author root; state Exp;
branches;
next ;
desc
@Process 2
@
1.1
log
@Initial revision
@
text
@#include
…
by
saurabh.hmr009
May 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
RCS file Zombie process shown:
head 1.1;
access;
symbols;
locks
xenial-xerus:1.1; strict;
comment @ * @;
1.1
date 2017.05.25.17.35.09; author xenial-xerus; state Exp;
branches;
next ;
desc
@show zombie pr…
by
sankalpnegi2310
May 2017
Pravjot Sir Classes
permalink
B97 : Project.03 Linux System Programming using Processes, IPC, Sync & Threads
RCS File to show orphan process :
head 1.1;
access;
symbols;
locks
xenial-xerus:1.1; strict;
comment @ * @;
1.1
date 2017.05.25.17.34.34; author xenial-xerus; state Exp;
branches;
next ;
desc
@orphan show…
by
sankalpnegi2310
May 2017
Pravjot Sir Classes
permalink
More Results
Powered by
Vanilla
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership