mariusae / trickle

Trickle is a userland bandwidth shaper for Unix-like systems.
https://www.usenix.org/legacy/event/usenix05/tech/freenix/full_papers/eriksen/eriksen.pdf
Other
562 stars 61 forks source link

Make trickle multithread version signal safe #4

Open lano1106 opened 10 years ago

lano1106 commented 10 years ago

Because, select(),poll(), read(), write() and many other overloaded functions are normally reentrant from signal handlers, we need to block all signals while we hold mutex or else we can deadlock.

Modified Makefile.am because while make did not build libtrickle.so, 'make install' was trying to install it. I'm really shooting in the dark for autoconf problem so maybe it is not the best way to resolve the problem.

lano1106 commented 10 years ago

There is still some rework to do.

oset should be private to every thread. thread B could overwrite oset while thread A has the mutex.

lano1106 commented 10 years ago

I have been using this patch for over a month with the bitcoin client and trickle has never been that stable.

I am 100% confident that this patch is ok.