Add NX_PER_CLIENT_DATA support for NuttX and eCos - #196
Conversation
Signed-off-by: Acfboy <AcfboyU@outlook.com>
|
Hello @Acfboy, In general this looks very good, thank you. I have a few small comments I'll place next to the source lines. I have one big concern which is duplicating the entire function nxPaintNCArea in a separate file nxpaintnc.c. When I suggested separating that function from nxdraw.c, I was hoping to see the function removed from nxdraw.c also, and not having the entire nxpaintnc.c file #if MULTITHREAD_SERVER. Maintenance is much harder when a function is duplicated in its entirety in separate source files. Can you make it work by optionally including serv.h in nxpaintnc.c only for the MULTITHREAD_SERVER case, thus having only a single copy of the function source? If so, please go ahead and do that. Thank you! |
b22e48f to
258719c
Compare
|
Thanks, fixed. |
|
This looks great, thanks for the changes. Do you want a review from the people on your side? Let me know when you'd like to commit, thank you! |
|
Perhaps we should wait until I submit the PRs in nuttx and nuttx-apps, and then let @ppsia take a look as well. |
ppisa
left a comment
There was a problem hiding this comment.
As for MULTITHREAD_SERVER, there are more changes. As I understand that should be safe because it should not have potential to break anything else than ECOS which is not actively maintained anyway. So no damage for most used targets.
I have still some taste that MULTITHREAD_SERVER is not the right name. But I am not sure if I am right. I have feeling that it should be something like NANOX_PER_THREAD_CONNECTION or something similar because I think that this is main purpose. But I can be wrong and the @ghaerr opinion and consideration about disruptiveness of the changes are the most important.
| */ | ||
|
|
||
| #define NANOWM 1 | ||
| #ifndef NANOWM |
There was a problem hiding this comment.
I would suggest to minimize dependency on external defines there as I write in apache/nuttx#18566 (comment) . If there is only single externally configurable option required then (may it be use) have two separated config files , one for case with Nano-WM mwconfig.nuttx-nanowm and another without it mwconfig.nuttx or to leave this file there as a template/example and generate another one during config. But I agree that neither is ideal.
| @@ -2,7 +2,10 @@ | |||
| * Included by mwconfig.h via -DMWCONFIG_FILE='"mwconfig.nuttx"' | |||
| */ | |||
|
|
|||
There was a problem hiding this comment.
I would consider to add there
#undef NUTTX
#define NUTTX 1
It should propagate to exported headers this way even when the number of exported defines is kept on minimum, i.e. only
CFLAGS += -DMWCONFIG_FILE='"mwconfig.nuttx"'
Signed-off-by: Acfboy <AcfboyU@outlook.com>
In a flat build the client library and the server share a single address space and several client tasks can connect to the server at the same time. All per-client statics of the client library are therefore moved into a structure whose pointer is kept in thread-local storage, and controlled by a standard MULTITHREAD_SERVER define now.