ECP-VeloC / AXL

Asynchronous Transfer Library
MIT License
2 stars 8 forks source link

Don't put axl_pthread_data pointer in KVTree #59

Closed tonyhutter closed 5 years ago

tonyhutter commented 5 years ago

This patch uses a linked list to lookup which axl_pthread_data is associated with each AXL ID. Why put it in a linked list instead of just storing the pdata in the kvtree? Because if we put it in a kvtree, and the app dies, the pdata pointer becomes stale, and would get erroneously freed as part of an AXL_Stop(). Instead we use axl_pthread_data_lookup(), axl_pthread_data_add(), and axl_pthread_data_remove() to access the data. This makes it so the pdata is ephemeral, only existing while the app is running.

tonyhutter commented 5 years ago

Fixes https://github.com/ECP-VeloC/AXL/issues/51

tonyhutter commented 5 years ago

The build failures are a KVTree bug (https://github.com/ECP-VeloC/KVTree/issues/27). We'll need to get that fixed first before this goes in.

tonyhutter commented 5 years ago

https://github.com/ECP-VeloC/KVTree/pull/28 should fix the build failures

tonyhutter commented 5 years ago

@adammoody I just pushed a fix for pdata = pdata->next. Can you take another look?

tonyhutter commented 5 years ago

@adammoody I fixed the other pdata = pdata->next