View Single Post
Old May 7th, 2008, 11:54 AM   #5
nannu
Newbie
 
Join Date: Apr 2008
Posts: 19
Rep Power: 0 nannu is on a distinguished road
Re: $$$ Need C programmer for Operating Systems programs

Hello there
I have been out of school for years now. I have been working for a private financing company for a while now; Nothing too big and nothing too special. What I love about little companies is that they give us the opportunity to have a close relationship with all of the employees. Our IT department is made up of 3 guys and I interact with them a lot. After seeing all of the cool stuff they can do, I thought that I would give the course a shot. The course that I am taking is not for credit or anything. Like I said before, I just signed up for the class to help me better understand Programming even though my studies were related to financing/ Acc. But after taking the class, I see that for me personally, Programming is very challenging and I have even more respect for what the guys do at my work. They work long hours and are always tired, I used to wonder what was up with that, but now I understand. I have an easier time looking at the programs and then understanding what is going on, but besides that how to write it up and all, that is not happening. I have been on other forums and tried to get some help, but am not getting very much feedback for the three programs that I listed. I am kind of disappointed at myself for not getting it, I am always up for a challenge but I can't believe I am saying this, but this time I got by Bu** kicked. I need these done, because the class is only a few weeks long. I am listing the programs that need to be completed below. I should have done that earlier. I really hope someone can help and hopefully it can probably be a challenge for someone out there to refresh their memory. Hope to hear from someone soon.
Thank you guys

***********************************************
I HAVE BEEN TOLD THESE MUST BE DONE IN C.
***********************************************
Program 1:
Mutual Exclusion
Write a program with two threads sharing a variable. One threads repeatedly
subtracts a constant values from the shared variable, while the second
repeatedly adds the same value. If the number of transactions that the threads
execute is the same, then the value of the shared variable after the threads
complete should be the same as the initial value – that is assuming access to the
shared variable is mutually exclusive.

First write the program without any code to protect the critical section, and test it
with a large number of iterations (hopefully the final value should deviate from
the original). Then incorporate a mutex lock into the solution and test it again.
That should ensure data consistency, and the program output should confirm it.

**************************
Program 2:

Networking
You are to implement a multi-threaded server that logs all messages sent to it by
clients. In addition to the messages, the log includes a timestamp of every
message stored. Whenever the server receives a message from the client, it
outputs the entire log of messages to stdout. A log can be represented simply as
a character string with a maximum size of 1000 characters. Since all the threads
are sharing the log, you must protect access to it.


******************************
Program 3:
Write a program in C that will do the following.
- declare a structure with two fields, one of which must be a string (declared as a char*)
- create an array of 5 pointers to the structure declared, and then allocate memory for the structures ( that includes allocating memory for the fields)
- populate the array of structures with user-entered date.
- print all the structures ( perform this step again after the next step)
- sort the contents of the array on the string field ( this should not require copying of any data, just pointer manipulations)
Implement each of the steps, 2 through 5, as a function.
*************************************************

Last edited by nannu; May 7th, 2008 at 12:07 PM.
nannu is offline   Reply With Quote