multithreading - epoll/select for mutexes/semaphores -
when have set of pipes/sockets waiting read/write, epoll() or select() can used wait on of them until @ least 1 of them ready read/write.
is there similar threads/pthreads? closest i've got on doing making sleeping thread blocking on lock() mutexes. however, costs thread each lock.
i thought using pipes instead of these locks, seems inefficient, , pipe count seems limited around 500 pipes (at least it's little higher threads).
so yeah, there better solutions using threads on waiting mutexes unlock?
eventfd
might of use you. should work same way pipes overhead much smaller.
if you're hitting 1024 open files limit, can increase as want using ulimit. but, if have many locks, there should more intelligent use of eventfd's.
here's more info: http://man7.org/linux/man-pages/man2/eventfd.2.html
Comments
Post a Comment