LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2013, 10:19 AM   #1
siya25
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Rep: Reputation: Disabled
i want to implement a group chat application using message queues..


the details are: there should be 2 grpoups A and B.group memebers are coonected using some structure like star or square and have their own group leaders. and within group,members can communicate through leadrer only..group A member can communicate to group B member according to their node position in the topology..
i know how to communicate between 2 processes with msg queue but facing problem with so many constraints and conditions??


any idea how to implement in SYSV...?
thanks in advance..
 
Old 01-16-2013, 10:53 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,517

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
Here's one of the instances where Wikipedia comes in handy -- there's a really good article, including a bunch of links to other articles that may help get your arms around what you're trying to do; see http://en.wikipedia.org/wiki/Message_queue.

System V (SVR4) and Linux messages queues are pretty much the same; I've done queues (well, inter process queues anyway) in Solaris that have ported cleanly to Linux. Haven't done what you're talking about but the Wikipedia article looks to me like a good starting point and maybe one or more of the links look pretty interesting.

Best of luck with it!

Hope this helps some.
 
Old 01-17-2013, 05:05 AM   #3
siya25
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
thanks tronayne..!!
but i need a kind of help for programming the above problem as iam nt soo gud at it.
so pseudocode or a general idea will be more helpful....
 
Old 01-17-2013, 06:52 AM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,517

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
Doing a little looking around I came across an article that might just be what you're looking for at http://wiki.secondlife.com/wiki/Mess...aluation_Notes.

Thing is, message queues aren't really for doing the sort of application you're talking about (they're for inter process communication, along with semaphores and shared memory). IPC is kernel-level, not user-level and have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue; that's not too good for group chat.

The evaluation article link above explores and evaluates a number of available applications and methods that may fit your purpose and I'd give it a good read (plus look at one or more of the evaluated applications or methods). I kind of think you may be talking about the sort of application that you see at some technical support sites were you can chat with a technician on line and I may have confused that with the IPC facilities so take a look and see what you think.

Hope this helps some.

Last edited by tronayne; 01-17-2013 at 06:53 AM.
 
Old 01-17-2013, 10:03 AM   #5
siya25
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
u r not confused tronayne..u r getting it right.I am talking about IPC..
this is my subject assignment..i dont want to make the real chat applicatn but a kind of it whre different processes can communicate.The way simple 2 process communicatn takes place like 1 send other recieves and other send 1st recieves.that is to be extended for more processes..there shud be communication within group and with other group also.And that is to be done using message queue only.

I hope now my problem is more clear.

Last edited by siya25; 01-17-2013 at 10:06 AM.
 
Old 01-17-2013, 10:38 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,517

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
OK, here's an example: http://www.cs.cf.ac.uk/Dave/C/node25.html that might help.

Essentially what you need to do is write a daemon (or a program that allocates message queues and runs in background). Then you write an additional program that is used by individual users (doesn't matter how many users) to post and receive messages from the queues. That's the basic idea -- one "supervisor" program, one or more instances of "user" program interacting with the supervisor.

Think data base management system (DBMS). A DBMS is started, it allocates shared memory, semaphores and, possibly, message queues. Individual users or processes execute queries against the tables in the data base and, to prevent more than one process updating a table at the same time, the DBMS uses semaphores and (potentially) message queues to avoid deadlock (more than one process updating simultaneously).

Use the example above to fiddle with message queues and see how they work then build on that to do what you're trying to accomplish.

Ought to get your started.

Hope this helps some.
 
1 members found this post helpful.
Old 01-20-2013, 10:31 AM   #7
siya25
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
for 8 nodes i created 8 instances of a program.whn i want to communicate within a grp i can directly use msg queue to send and recieve msgs but for communication with the node of another group i had to go through leader...how to implement that i am not getting..?
any ideas??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows chat client communicates with Linux server chat application friend511 Linux - Newbie 1 05-16-2012 07:56 AM
POSIX Queues with message type facility of System V queues ehsan_haq98@yahoo.com Programming 2 12-27-2009 12:45 PM
POSIX message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 11:15 AM
Message Queues naga_presin Linux - Networking 1 05-20-2006 04:26 PM
Message Queues BoldKiller Programming 1 05-28-2003 06:40 PM


All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration