<div><span class="gmail_quote">Hi Joel<br><br>> Although I think i-Logix Rhapsody and Rose Rational support would<br>> be great for RTEMS, they are for commercial products and I do not<br>> think that would be in the spirit of the SOC.<br>
<br>I see your point, it does make sense!<br><br>> It is a good project and having the option to configure a pool of 1 or<br>> more server<br>> threads is a good idea.  It could be application configurable.<br>> <br>
> For that matter, you might be able to extract the notion of a thread<br>> pool into something<br>> the user could provide plugins to for the specifics of the message<br>> processor function.<br>> Does that make sense?<br>
> <br>> Threads asynchronously queue requests, check on them, server pulls<br>> requests out<br>> and processes them.  The queuing, checking, and server pool <br>> infrastructure is<br>> basically independent of what the actual job is.  In C++, this would be<br>
> a good place<br>> for a class with an abstract function to override.  But in C, we have to<br>> resort to<br>> indirect function calls and providing sizeof structures.<br><br>You mean the user will provide callback functions? From wikipedia:<br>
"A potential problem is that stack depth can grow unmanageably, as an extremely common thing to do when one I/O is finished is to schedule another. If this should be satisfied immediately, the first callback is not 'unwound' off the stack before the next one is invoked. Systems to prevent this (like 'mid-ground' scheduling of new work) add complexity and reduce performance. The separation of textual (code) and time (event) flows provides fertile ground for errors."<br>
<br>Callback functions are widely (and reasonably) used in event-driven programming, nevertheless it is far more usual to see people using select/poll/aio_error loops.<br><br>Either way, it might be interesting to work on both ideas and deliver both features.<br>
<br>The server threads should be started on system init, right?<br>I'll make it user configurable through CONFIGURE_AIO_SERVER_THREADS (default=0)<br><br>To implement the callback feature, the aiocb structure will include a few more items (including a sizeof field). Any suggestions on how I can dispatch the callback functions? Or they'll be called within the server thread?<br>
<br>Now I'll start writing my proposal, i'd be glad if some of you could help me review it afterwards.<br><br>Thanks in advance, <br><br>André</span></div><br>