<bo********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi, I'm relatively new to programming and I would like to create a C++
multi user program. It's for a project for school. This means I will
have to write a paper about the theory too. Does anyone know a good
place to start looking for some theory on the subject of multi user
applications?
I know only bits and pieces, like about transactions, but a compendium
of possible approches to multi user programming would be very
appreciated!
It depends on what you mean by Multi User Programming, but the common
understanding is a Multi User Program will allow two instances of the same
program to access the same database files at the same time.
The way this is done is with record locking. Normally a program opening a
file for write has a file lock on it, meaning no other program can open that
file for writing until the program closes it. A Multi User Program will
open a file in "shared" mode and use record locking. Meaning this program
will now explictly place a record lock on a record it has open for write
(update) so no other program can read that same record for write.
Record locking is normally handled by some database system, such as SQL, and
SQL itself handles the record locking requests, although later verisons of
Windows handle record locking directly in the OS.
There is another form of Multi User Applications which share data. An
example of this would be a "whiteboard", where 2 computers connected via a
network can edit the same data. This is normally handled by each instance
of the application sending update information via the network to the other
instance of the application which updates it's own copy of the data.
Then you can have an application using shared memory. Each instance of the
application would look at the same memory as another instance of the
application. Again, you use locks, but now you use some form of memory
locks. I'm not sure if mutexes extend across applications.
With the advent of the internet, however, we see many forms of multi user
applications. IRC could be considered a form of a multi user application
(as well it could not be considered a form, it depends on your definition).
An MMORPG such as Everquest could be considered a form of a multi-user
application also, although it uses a client/server architecture.
This is really not a C++ question, however.