Introduce bi-directional cursors in threadskv5.c