[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Segfaults, etc.
I found the cause of the original segfaulting and fixed it. I committed
those changes.
But, now I have another problem:
When I send messages out I do:
while(elements on list) {
SendMessage();
}
When I remove an ID I modify the list...
The problem is the removeID calls are usually triggered during
a message send (ie, as a result of a message send). This is a
pretty big problem, because I cannot put a large lock around the
whole message sending or it would deadlock.
If I could protect the list from multiple thread accesses I'd be set --
but unfortunately I am using the STL list class, and the iterators are not
thread friendly. Anyone have any suggestions? I could just write my own
thread safe list class (either by mutexes or by slick programming), but
I'd rather not right now.
There is also the problem that you cannot go about deleting Interests,
because there might be a message send in progress, etc... *sigh* I
don't have enough time to work all this stuff out right now -- anyone else
is welcome to give it a shot.
Andrew