<div dir="ltr"><br><br>Am Dienstag, 17. Mai 2016 21:07:46 UTC+2 schrieb bel:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><br><br>On Tuesday, May 17, 2016 at 7:50:02 AM UTC+2, Christian Mauderer wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>The solution with the <b><span style="font-family:courier new,monospace">start_thread</span></b> callback is quite a different approach than my original one but it looks like a quite portable solution.<br><br></div></blockquote><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Am Freitag, 13. Mai 2016 20:42:03 UTC+2 schrieb bel:<br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br><span style="font-family:courier new,monospace"><span><b>int </b><b>start_thread</b></span><b>(<span></span></b></span><span style="font-family:courier new,monospace"><b><span><span style="font-family:courier new,monospace"><b>const struct mg_context *</b></span></span></b></span><span style="font-family:courier new,monospace"><b><span><span style="font-family:courier new,monospace"><b><span style="font-family:courier new,monospace"> </span></b></span></span></b><span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">ctx</span></span></span><span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">,</span></span></span><b><span><span style="font-family:courier new,monospace"><b><span style="font-family:courier new,monospace"> </span></b></span>mg_thread_func_t</span></b> func, <b><span>void</span> *</b> param, <b>void **</b> handle, ... to be defined<b>)</b> <br>{<br>   stack_size <-- mg_get_option(ctx, "rtems_stack_size");<br>   other_params <-- </span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">mg_get_option(ctx, "rtems_whatever_options_you_<wbr>need");</span></span><br></div></div></blockquote><div> </div><div>I'm  not sure if that works. If I interpret the source correctly, the following prevents any key in the options that is not in your list of known options:<br>  <a href="https://github.com/civetweb/civetweb/blob/23266e11f4285ba9e608525ebb771062872099c9/src/civetweb.c#L12960" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcivetweb%2Fcivetweb%2Fblob%2F23266e11f4285ba9e608525ebb771062872099c9%2Fsrc%2Fcivetweb.c%23L12960\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGLPUMfZ5xnMvNg07nI4b5bGnsz5A';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcivetweb%2Fcivetweb%2Fblob%2F23266e11f4285ba9e608525ebb771062872099c9%2Fsrc%2Fcivetweb.c%23L12960\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGLPUMfZ5xnMvNg07nI4b5bGnsz5A';return true;">https://github.com/civetweb/<wbr>civetweb/blob/<wbr>23266e11f4285ba9e608525ebb7710<wbr>62872099c9/src/civetweb.c#<wbr>L12960</a><br><br>With that, all parameters would have to come from another source. Am I wrong?<br> </div></div></blockquote><div><br><br>It's difficult to keep an overview with two discussion threads here and additional threads at the RTEMS discussion forum.<br></div></div></blockquote><div><br>Currently you can more or less ignore the thread on the RTEMS mailinglist. Except for the one comment that I already forwarded above, there haven't been any discussions regarding the interface. We only had a long discussion where to put the updated sources. Integrate them like mongoose or put them in a (currently not existing) vendor software repository. This problem still exists and I don't really have any project time left to solve it. So it quite possible won't be solved that soon.<br><br>My suggestion would be that we agree to an interface in one of the threads here and then I'll ask again for some feedback on the RTEMS mailing list. Eventually it would be useful to start a new thread with a matching topic and close this and the other one with a pointer to the new one?<br> </div><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div>The main advantages of the <b><span style="font-family:courier new,monospace">start_thread</span></b> callback are flexibility and portability.<br></div></div></blockquote><div><br>I see your arguments. You have a strong focus on portability between different systems with a big range of schedulers. So I agree that the flexible solution would be the best.<br> </div><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div>It is correct, the <br><span style="font-family:courier new,monospace"><span>if</span> ((idx = <span>get_option_index</span>(name)) == -<span>1</span>) ... return NULL</span> <br>code in the <a href="https://github.com/civetweb/civetweb/blob/23266e11f4285ba9e608525ebb771062872099c9/src/civetweb.c#L12960" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcivetweb%2Fcivetweb%2Fblob%2F23266e11f4285ba9e608525ebb771062872099c9%2Fsrc%2Fcivetweb.c%23L12960\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGLPUMfZ5xnMvNg07nI4b5bGnsz5A';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcivetweb%2Fcivetweb%2Fblob%2F23266e11f4285ba9e608525ebb771062872099c9%2Fsrc%2Fcivetweb.c%23L12960\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGLPUMfZ5xnMvNg07nI4b5bGnsz5A';return true;">link above</a>  will currently not allow to set any parameters. <br>This can be solved, either by an <span style="font-family:courier new,monospace">#ifdef</span>, by a reserved prefix, ... don't worry, this is a secondary problem.<br>If we agree on the primary approach, this detail will not stop us.<br><br> So, all parameters can come from the same source.<br><br></div></div></blockquote><div><br>So the primary approach would be the <span style="font-family: courier new,monospace;"><b>start_thread</b></span> callback you mentioned above. If I interpreted it correct that would mean that the <b><span style="font-family: courier new,monospace;">mg_start_thread_with_id</span></b><span style="font-family: arial,sans-serif;"> would need an additional parameter to identify the kind of the thread (i.e. an enum). If the callback is set, it would use the callback to start the thread. Otherwise it would do the same as it does now. The callback would have to have the same parameters like <span style="font-family: courier new,monospace;"><b>mg_start_thread_with_id</b></span> (including the new one that identifies the kind of thread). Anything else?<br><br>What about the <b><span style="font-family: courier new,monospace;">mg_start_thread</span></b> function? It seems that it is never used. Is that some kind of legacy support function?<br></span></div></div>