<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
<br>
Note that kevent(2) is a multi-purpose API. The call you refer to as (1)<br>
is not actually the mainloop of tracelib run. Rather, the call a little<br>
further down is:<br>
<br>
keventstatus = kevent(kq, NULL, 0, res_kevents, MAX_SOCKETS, NULL))<br>
<br>
This will also return for new connections to the socket, which<br>
darwintrace.dylib creates. Depending on why kevent returned, the code<br>
will either process a line from a socket, or accept a new socket and<br>
then eventually call kevent again.<br>
<br><br></blockquote><div>Actually my question is what is the purpose of the call (1), because till what I understood, kevent(2) only lets the program proceed further when it will return and it only returns when it detects an event.</div><div>Call (1) is supposed to detect a read event. I am asking where exactly that read event happens that makes that kevent return.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
I actually think it would be enough to just implement a Ctrie, but if<br>
you can find a suitable BSD-licensed (or compatible) implementation that<br>
you can reuse instead of re-implement you could also do the demo you<br>
suggested. I don't mind either way.<br>
<br></blockquote><div><br></div><div>Ok, I will do that.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
>From what I can see, the proposal looks more detailed to me now.<br>
However, you are not yet addressing the inherent race conditions with<br>
the suggested approach in the shared memory area and the special<br>
conditions required due to use of shared memory, such as not being able<br>
to use normal pointers.<br></blockquote><div><br></div><div>I will update the draft to add those. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Please also look into the paper on arXiv I sent you a while ago, because<br>
that did seem the data structure proposed there would already solve some<br>
of our problems.<br></blockquote><div><br></div><div>Sure, I will make it a priority.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Don't underestimate the effort required to get the data structure<br>
implemented given the constraints of the environment. To be certain that<br>
your data structure works as it should, you will also have to write an<br>
extensive test suite for all functionality of the data structure,<br>
possibly using code coverage measurements.</blockquote><div><br></div><div>I didn’t mean to underestimate, I already see it's really complex to deal with so many things at a time. </div><div>I wanted to ask to get more clarity. Will put all effort & do the max I can.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Additionally, if you really think you'd be done with all of that early,<br>
you can include optional "stretch goals" that we can take up if you're<br>
done early, such as writing a test suite for trace mode functionality,<br>
writing documentation for the on-wire format between darwintrace.dylib<br>
and the server, etc.<br></blockquote><div><br></div><div>Sure, I will analyse all points again and add accordingly.</div><div><br></div><div><br></div><div>Mihir</div><div><br></div><div> </div></div></div>