Saturday, June 27, 2009

Multithreading

One of the big problems that I have been struggling with today has been chase errors and multithreading. I have finally managed to figure out how to solve the biggest error that was occuring. When I sent a request for a name list from a telnet connection to the peer the response is duplicated on occasion. I used mtuexes everywhere, which in hindsight could have been a problem because of dealicks. I eventually figured out I should consolidate it into two iterators, one for queued relay messages one from peer and one for all of the received messages. By placing a mutex around the iterator it doesn't have any troubles anymore.

No comments:

Post a Comment