Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1894 closed enhancement (fixed)

Improve ioqueue performance on multithreadeded environment

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.5
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


This ticket will apply the following updates on the ioqueue (most affected implementations are select & epoll):

  • Protection against high fds (i.e: fd > FD_SETSIZE) in ioqueue socket registration to avoid potential memory corruption caused by select().
  • Added new ioqueue API pj_ioqueue_trylock_key().
  • Event dispatcher functions should not wait if an ioqueue key mutex is locked by another thread (perhaps the event for the key is being processed by that thread), skip this key and process next ioqueue key.

Thank you Christian Ambach for the patches.

Change History (2)

comment:1 Changed 8 years ago by nanang

  • Resolution set to fixed
  • Status changed from new to closed

In 5194:

Close #1894: Improve ioqueue performance on multithreadeded environment.

comment:2 Changed 8 years ago by nanang

In 5196:

Re #1894: Fixed high socket descriptor check in ioqueue select, it should be against FD_SETSIZE instead of PJ_IOQUEUE_MAX_HANDLES, as PJ_IOQUEUE_MAX_HANDLES can be lower than FD_SETSIZE.

Note: See TracTickets for help on using tickets.