Is this problem in realease mode same like debug?
Freertos in debug mode have big periodic latency about 2ms, because it doing memory tests.
In realease mode this test are disabled.
Thanks for the input, but aren't you talking about LwIP now? I know about LwIP's dramatic slowdown when it checks its buffers every now and then, and yes, I have "DEBUG" defined when compiling so *if* FreeRTOS have some memory checking going on, it will be enabled. But wouldn't that also depend on the memory allocator used?
Anyway, I really think a proper multi-thread implementation (the BT stack in this case) should *not* depend on such timings, it shouldn't depend on *any* timing to work. That's more or less the definition of the phrase "atomic operation".