Ticket #717 (closed defect: fixed)
ncs_mqnd uses 100% CPU after IMM integration
| Reported by: | hafe | Owned by: | shekhar |
|---|---|---|---|
| Priority: | blocker | Milestone: | 4.0.0-M3 |
| Component: | MQSv | Version: | 4.0-B3 |
| Keywords: | Cc: | ||
| patch waiting for maintainer: | no |
Description
Same problem as in another ticket. The main thread spawns a new thread that executes the main poll loop of mqnd. After that the main thread initialize IMM and gets a selection object too late for the poll thread which is already spinning round in an EAGAIN with a bad file descriptor:
[pid 7395] recvfrom(22, 0x4007e390, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 7395] poll([{fd=16, events=POLLIN}, {fd=18, events=POLLIN}, {fd=13, events=POLLIN}, {fd=0, events=POLLIN, revents=POLLIN}], 4, -1) = 1
[pid 7395] recvfrom(22, 0x4007e390, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 7395] poll([{fd=16, events=POLLIN}, {fd=18, events=POLLIN}, {fd=13, events=POLLIN}, {fd=0, events=POLLIN, revents=POLLIN}], 4, -1) = 1
[pid 7395] recvfrom(22, 0x4007e390, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 7395] poll([{fd=16, events=POLLIN}, {fd=18, events=POLLIN}, {fd=13, events=POLLIN}, {fd=0, events=POLLIN, revents=POLLIN}], 4, -1) = 1
[pid 7395] recvfrom(22, 0x4007e390, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
[pid 7395] poll([{fd=16, events=POLLIN}, {fd=18, events=POLLIN}, {fd=13, events=POLLIN}, {fd=0, events=POLLIN, revents=POLLIN}], 4, -1) = 1
[pid 7395] recvfrom(22, 0x4007e390, 1, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
The idiotic common main in ncs_main_pvt.c must go! Please remove mqnd from that one and create a local main() routine that does initialize and then poll!
