Why do some interfaces in libubus.so use global variables?

I find some interfaces in libubus.so use global variables “struct blob_buf b”
such as ubus_invoke_fd(),ubus_lookup_id() and so on.

Is there any risk if I need to use multiple threads to call these interfaces concurrently?

1 Like

None of the OpenWrt core libraries (libubus, libubox, libuci etc.) are designed with thread safety in mind, you do need to structure your program in a way that ensures that only one thread at a time accesses these APIs.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.