• Post Reply Bookmark Topic Watch Topic
  • New Topic

Daemon Problem  RSS feed

 
Sashi Gundoji
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,

I am new to Java and I am programming with multiple daemons are running parallel. I have one problem. i used each daemon with synchronization.master daemon is always waiting for data from slave daemons.

master daemon {
synchronized (datareceived) {
while(processrunning) {
datareceived.wait();
do some process with data
}
}

slave daemon1 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}

slave daemon2 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}


The problem is if master daemon is not at the position of wait and if one of slave did send notify(), then i am loosing the notification.

What I want is, i should not loose any notification. I should respond on each notification. So please let me know if somebody can help regarding

Thank you,

Regards,
Dimpu
 
Henry Wong
author
Sheriff
Posts: 22861
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shashi,

Please don't crosspost. It wastes people's time and effort.

Henry
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!