BIND 10 #2861: synchronization between auth main thread and datasrc builder
BIND 10 Development
do-not-reply at isc.org
Fri Mar 22 07:56:28 UTC 2013
#2861: synchronization between auth main thread and datasrc builder
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | Status: new
Priority: medium | Milestone:
Component: b10-auth | Previous-Sprint-Proposed
Keywords: | Resolution:
Sensitive: 0 | CVSS Scoring:
Sub-Project: DNS | Defect Severity: N/A
Estimated Difficulty: 4 | Feature Depending on Ticket:
Total Hours: 0 | shared memory data source
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by vorner):
Hello
Replying to [comment:3 jinmei]:
> The issue of other synchronous communication such as a pipe is that
> how the main thread can check it; the main thread is normally sleeping
> in the ASIO event loop (unless it's a super busy server handling
> queries all the time), so we'll need something like an ASIO event
> posted by the other thread or timer based polling anyway.
Uh? Do we talk about the same thing? Pipe is a file descriptor, I can put
the reading end into ASIO and schedule a read event. So ASIO happily runs
the main loop (waits in some poll-like thing, handling the queries that
come out, the command FD, and the pipe).
Then, the background thread prepares the data somewhere and writes „It's
ready!“ to the write end of the pipe. The read end of pipe becomes
readable, which wakes the ASIO and the handler is called. Once it is
called, we can check the somewhere that it really does contain the
prepared data and pick it up.
The somewhere would be protected by lock, just to be sure. But it would be
locked only when the background thread stores the data (short time) and
when the main thread picks it up (again, short time). The pipe would be
used to only wake the main thread by the read event.
--
Ticket URL: <http://bind10.isc.org/ticket/2861#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list