Ticket #1894 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Description

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

comment:1 Changed 3 years ago by nanang

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

In 5194:

Close #1894: Improve ioqueue performance on multithreadeded environment.

comment:2 Changed 3 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.