![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2008
Posts: 19
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 498
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#3 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 747
Rep Power: 3
![]() |
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> |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |