Asynchronous communication between master and slave threads


 
Thread Tools Search this Thread
Top Forums Programming Asynchronous communication between master and slave threads
# 1  
Old 05-14-2013
Asynchronous communication between master and slave threads

I am writing a process that has a master thread and a set of slave threads. Master thread is supposed to get jobs dynamically and assign to slave thread which is free. Master also get results back from slaves once a job is done. The number of slaves should be adjustable dynamically based on job load.

The interesting thing is that when job is in progress, master may decide to stop a job. I am thinking of some way of communication between one(master) and many(slaves) to assign jobs, stop a job (specific to a salve which does the job), get results from slave.

Will message queues be useful?

Thanks in advance

/Tamil
# 2  
Old 05-14-2013
Sure, or something similar. If master has a queue to each thread, it can send tasks and stop requests. However, if you want a thread to suspend processing, it needs to be interrupted. Maybe all threads can service a SIGUSR1 to read a special queue or flag for such. Dispatching work without latency from excess buffering or lost cycles waiting on master or locks is one problem. Suspending and reactivating threads is another. Oh, BTW, lwp concurrent threads are a different problem than threads sharing a lwp.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. IP Networking

DNS question about initial Master/Slave setup

Hey everyone. I'm creating a DNS master/slave server set up. I have the configurations all done I believe, the master has the required zone file, and the named.conf file has the allow transfer and allow query stuff set. The slave has it's own configs set. My question is that when initially... (1 Reply)
Discussion started by: Lost in Cyberia
1 Replies

2. Programming

How to wait the slave to be finished first then execute the master--MPI C++?

Hi, How to wait the slave to be finished first then execute the master? Can someone give me the specific function? Or the detailed example. Thanks~ (1 Reply)
Discussion started by: wanliushao
1 Replies

3. AIX

Problem in communication nim client with nim master

Hello, I have an AIX6.1 machine which is a nim client to my nim master which is also AIX6.1 machine. I had some problem to perform an installation on my client using smit nim . i removed /etc/niminfo file in order to do the initialization again but when i run the command niminit -a name=client... (0 Replies)
Discussion started by: omonoiatis9
0 Replies

4. UNIX Desktop Questions & Answers

How can I replicate master master and master master MySQL databse replication and HA?

I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database. For this I have created two... (0 Replies)
Discussion started by: Palak Sharma
0 Replies

5. Web Development

MySQL Master-Slave Configuration: Don't Replicate a Row of a Table?

Anyone have a clue about this? I have checked the MySQL documentation and it does not seem possible to exclude a row of a table from replication between Master and Slave. It seems that replication in MySQL can only be managed at the table level, not at the row level. Does anyone know a work... (5 Replies)
Discussion started by: Neo
5 Replies

6. SCO

master and slave in lan network

hello , i setup a lan network , but i don't know how configure master and slave in the lan network please help me:confused: (2 Replies)
Discussion started by: hossein
2 Replies

7. UNIX for Advanced & Expert Users

NIS master / slave problems

Our NIS master server went down. We have since fixed it and brought it back up. However all of are machines still point to the slave server when looking at it with ypwhich. My question is how do i point the servers back to the master. Frank (2 Replies)
Discussion started by: frankkahle
2 Replies

8. Programming

asynchronous control of threads

I am attempting to build a library that is transparent to the client code. A shared resource is used by many threads with their own synchronization code, but every once in a while, ALL threads need to be stopped for some background control thread to update this resource before proceeding. I have... (2 Replies)
Discussion started by: Corona688
2 Replies
Login or Register to Ask a Question