Add lock and lockfree implentation for streams