Refactor io resources to use thread-safe queues