Skip to content

Add NX_PER_CLIENT_DATA support for NuttX and eCos - #196

Open
Acfboy wants to merge 2 commits into
ghaerr:masterfrom
Acfboy:master
Open

Add NX_PER_CLIENT_DATA support for NuttX and eCos#196
Acfboy wants to merge 2 commits into
ghaerr:masterfrom
Acfboy:master

Conversation

@Acfboy

@Acfboy Acfboy commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
@ghaerr

ghaerr commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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!

Comment thread src/include/mwconfig.h Outdated
Comment thread src/nanox/client.c Outdated
Comment thread src/nanox/client.c Outdated
Comment thread src/nanox/Makefile Outdated
Comment thread src/nanox/nxpaintnc.c
Comment thread src/Arch.rules Outdated
@Acfboy
Acfboy force-pushed the master branch 2 times, most recently from b22e48f to 258719c Compare August 11, 2026 15:39
@Acfboy

Acfboy commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, fixed.

@ghaerr

ghaerr commented Aug 11, 2026

Copy link
Copy Markdown
Owner

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!

@Acfboy

Acfboy commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Perhaps we should wait until I submit the PRs in nuttx and nuttx-apps, and then let @ppsia take a look as well.

@ppisa ppisa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"'
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@ghaerr ghaerr changed the title Add MULTITHREAD_SERVER support for the window manager Add NX_PER_CLIENT_DATA support for NuttX and eCos Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants