It depends if I'm giving the path name in the shell, or given just the command executable. Also, if there is piping or redirection, I call a different function.
But I'll just show you the one for...
Type: Posts; User: hansel13
It depends if I'm giving the path name in the shell, or given just the command executable. Also, if there is piping or redirection, I call a different function.
But I'll just show you the one for...
Great thanks. I got the signal handler to run, and if I type sleep 5 &, it works and prints out when finished. However, if I type sleep 5 &, and then type in another command like ls or ps after it,...
So right now my shell does everything fine, and this function runs in the background fine. However, I was wondering if there's a way for me to get a report printed to my screen shell when the...
We will see. My Dad is an engineer and works at Intel, so I might just follow in his footsteps there. Really depends on what school I get into for my Masters and how life plays out. Thanks for your...
Thank you sir, it works now.
I want to change this command line compile code:
gcc -Wall project.c -o outputFile -lposix4
to the following makefile:
CC = gcc
DEBUG = -g
I got this figured out, thanks. Feel free to lock this thread.
Well each producer thread writes exactly once. There's 20 producer threads, and 20 files. I don't care what order they go in, but they do what I want, which is producer a file ONCE.
Maybe for the...
OK Well I almost have everything running, that's the good news. The bad news is I really need this done tonight.
The problem right now is that it seems like only one buffer is being used the...
Hey, if they pay is good, I'm always open. I just know 2 people personally who have taken the route I hope to take, and they are in excellent shape financially. So hopefully with hard work, I can get...
Wow, that stuff already blows me away just trying to comprehend it. I'm actually more interested in moving into management eventually or even sales. I'm going to get my Masters in CS and my MBA. I...
I have set up the mutex as you mentioned. However, I should have mentioned, for this assignment, I can't use conditional variables. That would definitely make things easier.. Instead I'm using...
This is very similar to what I did, except I actually just dequeued inside the producer. I also got rid of that while loop in the producer like you pointed out. It was useless!
Jeff, I sent you a...
YES I finally got it to work for just one buffer slot. Everything is working fine. The TA gave me some tips, apparently my linked list s, should be declared GLOBALLY.
That and a few other things,...
OK, I fully understand that. But when I run the code without the pthread-join, I still don't get why the output only prints the producer twice like so:
IN PRODUCER
int = in1.txt
int = in2.txt
int...
Maybe I'm not understanding how creating pthreads work, but when I use pthread_join and print the file name queue list inside each producer, it prints 19 file names, then 18 file names, then 17 file...
Just realized that you don't have my input files, so that could be why you're having a problem..
How do I attach my files? I have them in a zip..
That's weird that you are getting seg faults, my code compiles and runs perfectly fine without any noticeable errors. But I'll check out what you have in the morning, thanks again!
YES! thank you, that's why my buffer was ever printing correctly. That solves a small problem, but better then nothing. I still am not getting the output I'm hoping for, but it was baffling me why...
Yeah the output order or aesthetically pleasing factor, really don't matter. The key is that each piece of text is read once and written once. So the output of my program should just show the content...
I probably should, but the thing is, if I take out the while loops from the producer/consumer functions, AND I just use buffer[0] as my only slot... And change the pthread creating to what I had...
Yeah I'll keep that in mind, can't wait to graduate with this bachelors degree so I can start my Masters.
I have my mutex and semaphore set up actually just like that, however when I implemented...
Well it won't store any of my file contents into the buffer, and right now, I'm have problems all together with my output.
NOTE: The while loops in the consumer and producer functions isn't...
Right on, I changed my code to do exactly that.
pthread_t producerVar[PRODUCERS];
pthread_t consumerVar[CONSUMERS];
for(i = 0; i < 20; i++)
{
...
Teacher's specifications to use 20 producers and 5 consumers. I'm not sure why these numbers were chosen, but I suppose it's to challenge us more.