Is wiced_http_get (NetX Duo) thread safe?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I found issues (lead to often tcp connect failure in wiced_http_get) if i'm trying to call wiced_http_get on more than one threads... From the look of wiced_http_get it seems Thread safe but i cannot be 100% sure. This issue can only be reproduced if i leave it running for hours with 2 thread calling wiced_http_get with 1 seconds delay after operation return (either success or failure). Does anyone has any idea?

Best Regards,

Aaron Lee

0 Likes
5 Replies
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,

The wiced_http_get() NetX Duo is thread safe. The issue may be a stack overflow issue, please check.

Thanks,

Seyhan

0 Likes
Anonymous
Not applicable

Its not thread stack size issue, i use 2 thread, one which i created with 8K of stack size while the other one is using the pre-created network thread (i believe its 6K of stack size). Each thread does not call the https get function more than once since its a blocking function.

0 Likes

It might make sense to print the error message at the NetX_Duo level, if an error returned by any NetX_Duo function called inside wiced_tcp_connect(). We are mapping the NetX_Duo errors to Wiced Errors; so it would be better to get the Netx_Duo error itself.

0 Likes
GregG_16
Employee
Employee
50 sign-ins 25 sign-ins 25 comments on KBA

Any update?

0 Likes
Anonymous
Not applicable

Hi Gangi,

We use a unified thread to access all HTTP request to go around this issue, we haven't had the time yet to dig deeper to find the concurrent HTTP access issue. I will feedback when we come back to check this issue, however, this can be easily reproduced from my original post so anyone who is interested can also help to check this issue.