12 Topics

Member Avatar for
Member Avatar for myk45

Hi All, I am trying some experiments with pthread scheduling policies. I have a couple of apps and within all these apps, I set the thread policy to SCHED_RR and I set the priority to MAX - 1. Now, I see that the CPU utilization as reported by top for …

Member Avatar for iš_iš_iš
0
234
Member Avatar for Raghu Dev

can anyone help me in making a c program for displaying the grades(A(>60),B(45>b<60),C(30>c<45),F(fail)) of students in the form of histograms and for each grade calculation and histogram we need to use pthreads!!! so that it satisfies parallel processing!!

Member Avatar for Edward_3
0
145
Member Avatar for John Linux

In a past prac. exam for an algorithm course I'm doing is the challenge below, and their are no solutions but it seems like a really interesting one to solve. Can someone please help and point me in the right direction, I would like to try this on my own, …

Member Avatar for Sergio_1
0
497
Member Avatar for nerdygirl118

The assignment is to implement the Banker's Algorithm using pthreads and mutex locks. We implemented the Banker's Algorithm and it works fine. When we began implementing the pthreads and mutex locks we ran into problems. We know that each process is a thread, and that the mutex lock is acquired …

Member Avatar for deceptikon
0
153
Member Avatar for fyra

Hi people. I wonder how I can free the pthreads' allocated memory? #include <pthread.h> #include <stdio.h> #include <stdlib.h> #define NUM_OF_THREADS 10 void* print_thread_id(void* tid) { printf("Greetings from thread %d\n", (*(int*)tid)); pthread_exit(NULL); } int main(int argc, char* argv[]) { pthread_t threads[NUM_OF_THREADS]; int status, i; int* n_thread; for(i = 0; i < …

Member Avatar for Banfa
0
276
Member Avatar for Serafel

My basic problem is that I'm having a hard time implementing a Pthread that consists of a round robin dequeuing 4 arrays consisting of ints. Followed by a Pthread that creates random numbers with which to enqueue them with. I've written most of the code for the queue itself and …

0
214
Member Avatar for g-pita

Hi I'm trying to create a program that gathers data from some ADC connected and do some averaging on the data. It's build up around classes containing systeminterface and sensors making a datamodel. The program is pretty big, but has worked intil implemention of pthreads I wanted to create a …

0
113
Member Avatar for anurag.kyal

All I have to do is take an array of n integers and run p threads to sort equally divided p blocks of the same and finally merge them. There is occuring some problem in my code. If I run the threads one by one, by using pthread_join's before next …

Member Avatar for nezachem
0
170
Member Avatar for John Linux

I am using a) Linux b) Pthreads I want to write a program, with two pthreads, to cater for two queues of people. People arrive at each queue at a random interval of 1 - 10 seconds. Each time a person arrives, print out the number of people in each …

Member Avatar for John Linux
0
178
Member Avatar for dos_killer

hello im new to linux programming and i am experiencing a bit of diffuclty with pthreads...basically the pthread_create() function in my code below i tend to pass an integer variable as the argument for my runner() function but i get a warning and an error..i have tried several ways of …

Member Avatar for gerard4143
0
755
Member Avatar for vavazoom

I'm working on a project that utilizes producers and consumers for an operating systems class. Each producer and each consumer will be its own thread. The producers will generate records that will be stored in a global buffer, in which the consumer will then access to use the data. I …

Member Avatar for mike_2000_17
0
270
Member Avatar for shinsengumi

Can anyone help me improve my source code below? I tried fixing it but apparently, there's not much success. [CODE] #define NUM_THREADS1 1 void *go_to_website2(void *program); void *go_to_website1(void *program) { char* str[3]; str[0] = (char *)program; str[1] = "http://www.google.com"; //supposedly 2nd website to go to str[2] = '\0'; char* new_prog …

Member Avatar for shinsengumi
0
196

The End.