Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Iain Clarke, Warrior Programmer25-Oct-09 9:42
Iain Clarke, Warrior Programmer25-Oct-09 9:42 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:51
Manmohan2925-Oct-09 9:51 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Richard MacCutchan25-Oct-09 12:27
mveRichard MacCutchan25-Oct-09 12:27 
JokeRe: int returned as binary no. from CListCtrl::InsertItem Pin
CPallini25-Oct-09 9:17
mveCPallini25-Oct-09 9:17 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
«_Superman_»25-Oct-09 8:55
professional«_Superman_»25-Oct-09 8:55 
GeneralRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:07
Manmohan2925-Oct-09 9:07 
AnswerRe: int returned as binary no. from CListCtrl::InsertItem Pin
Manmohan2925-Oct-09 9:46
Manmohan2925-Oct-09 9:46 
QuestionIPC Programme Need Help ! Pin
appollosputnik25-Oct-09 8:04
appollosputnik25-Oct-09 8:04 
Question :

The “Dating Game” is an IPC problem which illustrates the sorts of problems that processes
might face if they must try to blindly locate one another. The model uses two sets of processes: males
and females, and the objective is to arrange couples of one male and one female each.
It is guaranteed that:
• each process knows their own sex;
• each process knows their own process ID;
• each process cannot tell the sex of a process simply by examining its process ID; and
• there may be an arbitrary number of males and females in the system at any given moment.
A process has found a mate if they know (by say, storing it in their memory space) the process ID of
a process of the opposite sex, but also if the same condition holds for the opposing process as well.
In other words, m is the mate of f when f knows m and m knows f. At this point, they can start
chatting, sending love letters, buying each other gifts and doing all the things that couples tend to do.
All of this cannot come about without the special intervention of the dating server. The purpose of the
dating server is to find mates for the many fish in the sea. The dating server [process] is well known
by all of the processes in the system, and so consider its process ID to be a universal system constant.
Your primary job in this question will be to solve the dating game using the family of message-passing
IPC primitives: nonblocking send and blocking receive.

(a) Using the messaging system calls, you will simulate the interaction described above.
They are:
• msgget(...) which either: creates a message queue in the case of the dating server; or
identifies a queue, in the case of a male process or a female process.
• msgrcv(...), which will be used as a blocking call for this implementation. All messages will
have a nonzero message type: the unique number associated with each receiver. Messages to
be sent to the dating server will be of type 1; messages to be sent to a process with process
ID n will be of type n.
• msgsnd(...), which will be used as a nonblocking call for this implementation. All messages
sent will have a nonzero message type.
• msgctl(...), which will be used to dismantle the queue.


Your job will be to write the programs for dserver.c, male.c, and female.c, using the message-
passing primitives described above. Mated couples should pass some messages back and forth
before exiting.
Messages are sent to and received from a single queue whose key is the last 5 digits of your student
number. Be sure to update global.h before you begin!
The program dispatcher.c will create males and females at some arbitrary times. You may
modify dispatcher.c, within reason. When testing your code, we will replace dispatcher.c with
our own custom-built version that creates males and females according to our favorite distribution.
In all other aspects, dispatcher.c will be the same as the sample.

(b) [10 marks] Draw a process diagram that illustrates the interaction between the dating server, male
processes, female processes, and the dispatcher. Show any process creation, send or receive.
(c) [5 marks] An analog to the dating server exists in most systems. It is called a nameserver. Explain
what might happen in a client-server system in which there was no nameserver.
(d) [15 marks] It is possible to solve the dating game problem without messages and a dating server.
Instead, we used a shared memory space, some semaphores and two global variables. Write some
pseudocode for functions male() and female() that accomplishes this.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

Dear Friends
I have to answer all these a,b,c,d answers can you tell how can I develop sucha IPC application.
Some hints: If anybody has come across such IPC development can you give me some hints to develop an IPC program in VC++ in C language !

Any help would be appreciated
Thanks
AnswerRe: IPC Programme Need Help ! Pin
CPallini25-Oct-09 9:11
mveCPallini25-Oct-09 9:11 
QuestionRegarding Colors for the Entire Colums in a CListCntrl Item. Pin
janaswamy uday25-Oct-09 6:25
janaswamy uday25-Oct-09 6:25 
AnswerRe: Regarding Colors for the Entire Colums in a CListCntrl Item. Pin
Rajesh R Subramanian25-Oct-09 6:42
professionalRajesh R Subramanian25-Oct-09 6:42 
QuestionUsing splitter in the CDockablePane Pin
AshishMahajan25-Oct-09 6:13
AshishMahajan25-Oct-09 6:13 
QuestionMemory Leak Part II Pin
BarryPearlman25-Oct-09 4:45
BarryPearlman25-Oct-09 4:45 
AnswerRe: Memory Leak Part II Pin
Rajesh R Subramanian25-Oct-09 6:14
professionalRajesh R Subramanian25-Oct-09 6:14 
GeneralRe: Memory Leak Part II Pin
BarryPearlman25-Oct-09 14:09
BarryPearlman25-Oct-09 14:09 
GeneralRe: Memory Leak Part II Pin
Rajesh R Subramanian25-Oct-09 16:31
professionalRajesh R Subramanian25-Oct-09 16:31 
AnswerRe: Memory Leak Part II Pin
cmk25-Oct-09 7:01
cmk25-Oct-09 7:01 
QuestionWant to ask about recv() and sent() function in sockets. Pin
WindowsVsLinux25-Oct-09 2:33
WindowsVsLinux25-Oct-09 2:33 
AnswerRe: Want to ask about recv() and sent() function in sockets. Pin
Richard MacCutchan25-Oct-09 3:08
mveRichard MacCutchan25-Oct-09 3:08 
GeneralRe: Want to ask about recv() and sent() function in sockets. Pin
WindowsVsLinux25-Oct-09 3:27
WindowsVsLinux25-Oct-09 3:27 
GeneralRe: Want to ask about recv() and sent() function in sockets. Pin
Richard MacCutchan25-Oct-09 3:59
mveRichard MacCutchan25-Oct-09 3:59 
GeneralRe: Want to ask about recv() and sent() function in sockets. Pin
WindowsVsLinux25-Oct-09 4:14
WindowsVsLinux25-Oct-09 4:14 
GeneralRe: Want to ask about recv() and sent() function in sockets. Pin
Richard MacCutchan25-Oct-09 5:53
mveRichard MacCutchan25-Oct-09 5:53 
GeneralRe: Want to ask about recv() and sent() function in sockets. Pin
hugewave25-Oct-09 6:44
hugewave25-Oct-09 6:44 
AnswerRe: Want to ask about recv() and sent() function in sockets. Pin
cmk25-Oct-09 6:51
cmk25-Oct-09 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.