473,416 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Multi user programs

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!

Nov 22 '05 #1
5 5683
On 2005-11-21 12:38, bo********@gmail.com wrote:
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!


What exactly do you mean with multi-user? Several users using different
instances of the same application at the same time or multiple users
using the same instance of the application at the same time (kind of
outdated now days).

The easiest approach would probably be some kind of client/server
solution. Then you would only have to worry about locking on the server-
side. With some luck you might use a database and let it do all the
locking for you (which is good since it can be hard to get right).

Haven't got many tips about books/articles to read but taking a look at
your local library for books about concurrent computersystems might turn
something up. Not sure if it's good but I've read 'Multithreaded,
Parallel, and Distributed Programming' by Gregory R. Andrews, I suspect
it's as good as any.

Erik Wikström
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
Nov 22 '05 #2
<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.
Nov 22 '05 #3
>>> 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.

I would suggest you first have some idea about the application you want
to build.

Technator
www.hcl.in

Nov 22 '05 #4
technator wrote:
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.

I would suggest you first have some idea about the application you want
to build.

Technator
www.hcl.in


It wil be a C++ program wherin two or more users will share a datafile.
the project is meant to convert the current, single-user application,
to a multi-user application. The current software architecture of the
program consists of the program opening a text-based file and reads the
data from there. It is in problem to convert to a database, but it is
requested not to.

The program has to be run on serveral computers simultanuously. There
should be some data hiding, users are meant not to see all data, but
subsets of the data.

I would like to know what possibilities there are in regard to
multi-user programming. Is it possible to share a data-file on a
computer? What if I don't use a database? Stuff like that!

Thanks to anyone who replied!

Nov 23 '05 #5
On 2005-11-22 11:31, bo********@gmail.com wrote:
technator wrote:
>>> 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.

I would suggest you first have some idea about the application you want
to build.

Technator
www.hcl.in


It wil be a C++ program wherin two or more users will share a datafile.
the project is meant to convert the current, single-user application,
to a multi-user application. The current software architecture of the
program consists of the program opening a text-based file and reads the
data from there. It is in problem to convert to a database, but it is
requested not to.

The program has to be run on serveral computers simultanuously. There
should be some data hiding, users are meant not to see all data, but
subsets of the data.

I would like to know what possibilities there are in regard to
multi-user programming. Is it possible to share a data-file on a
computer? What if I don't use a database? Stuff like that!


Since it has to run on many different computers at the same time a
server/client solution would be the best. Write a server application
which has access to the file, and client applications which sends
requests for reading/writing to the server (which does the acctual work).

An easy solution could be to have several threads on the server which
accepts connections from the clients, places the request in a queue.
Another thread services the requests one by one from the queue. Then you
would only have to use a lock to access the queue (and there are lots of
examples of the producer/consumer pattern out there to look at).

If the file is very large or you expect very many clients a databases
server might be better, then you only have to program the clients and
can use ODBC or something similar to connect to the database. The pros
with a database is that you don't have to worry about concurrency or how
to select which parts of the file to send to the clients (if the data is
well structures a nice SQL-query will take cara of that) and it's fast.

Erik Wikström
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: strong | last post by:
may you help me?? thanks!! I want to establish a environment to server multi-user in win2000 I run a cgi-multithread-server program,its name is cgisrv.py and I write two programs to test it, one...
6
by: Andrew V. Romero | last post by:
First off, I am mostly familier with PHP but am trying to make a multi-step javascript program. For an example, I would like to run different sections of the script depending on how many times the...
4
by: Ed | last post by:
Does anyone know of a way to create a complex multi column form (like the ones that can be created in programs like MS-Access)? This is for a secure WAN where all users will be using MS Internet...
3
by: canigou9 (remove your socks to reply) | last post by:
(cross posted - comp.databases.ms-access, microsoft.public.access) Hello folks - this is my first post here, after a short lurk. I have written an application in Access2002 for a friend's...
4
by: Max | last post by:
Playing around with multi-threading programs and ran into this little problem that maybe someone here could explain... Basically I have a class which launches a form object. Once the form is...
23
by: Kaz Kylheku | last post by:
I've been reading the recent cross-posted flamewar, and read Guido's article where he posits that embedding multi-line lambdas in expressions is an unsolvable puzzle. So for the last 15 minutes...
7
by: Michael Butscher | last post by:
Hi, this is not really Python-specific but I need it for Python. I'm wanting a method for interprocess communication which is OS- independent (sockets would be the normal way to go), but which...
3
by: Fred | last post by:
We all agree that multi-core is where the industry is headed. Can the .NET framework take advantage of multi-cores? are the programs written in .NET multi-threaded by default or is additional...
5
by: M.Liang Liu | last post by:
I have a project with the following dirs: --------------------------------------------------------------------------------------- +src |-proj0 |-program1 |-program2 |-proj1 |-program1...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.