Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 12th, 2008, 9:39 PM   #1
nannu
Newbie
 
Join Date: Apr 2008
Posts: 19
Rep Power: 0 nannu is on a distinguished road
Operating System

Hey guys, hope all is well. I am having some trouble with some programs that I need to do for my Operating System. Can someone please advise me on some good web-sites to get help from for my programs. For example, one of my projects asks for:

Project: 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.
Can someone give me an idea of how to do this. Any help would be appreciated.

Thanks in advance
nannu
nannu is offline   Reply With Quote
Old Apr 12th, 2008, 10:17 PM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 498
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: Operating System

There are lots of ways to implement a server. www.DataReel.com has a whole free library full of code, some of it is a working client and server using sockets. In order to do yours you will have to learn about socket programming so that the client and server can talk to each other.

There are several tutorials that may be of interest to you.
__________________
I Like Ike. Vote for Dwight Eisenhower this November.
--This message brought to you by the the Procrastinators Club Of America.
Ancient Dragon is offline   Reply With Quote
Old Apr 13th, 2008, 2:38 AM   #3
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 747
Rep Power: 3 Jimbo is on a distinguished road
Re: Operating System

ingredients:
Output file
mutex to access output file
server socket (to listen for messages)
threading API

instructions:
when the server starts a connection, it should spawn a new thread to log the message. That thread should repeatedly check if the mutex for the file is available. When it is, the thread locks the file, writes its message, and releases the file.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Facial recognition system PhilBon Other Programming Languages 3 Jun 12th, 2007 7:00 PM
Favorite Operating System Nebula Coder's Corner Lounge 111 Nov 2nd, 2005 12:33 PM
PHP system commands ktsirig PHP 6 Oct 4th, 2005 1:24 AM
Why shouldn't we use System(); Shapeless C++ 7 Jul 19th, 2005 6:10 AM
System Info Da-Kid C++ 9 Feb 15th, 2005 6:46 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC