![]() |
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 |
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. |
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. |
| All times are GMT -5. The time now is 4:09 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC