Flash memory-based storages are used in a wide range of systems from small mobile devices to large-scale system servers. The performance demand from applications and the technology of flash memory vary widely from one system to another, making it difficult to design a universal flash memory scheduler for all systems. In this paper, we present a framework for efficient and flexible flash memory scheduling and compare a software scheduler based on the framework against an optimized hardware scheduler. The throughput of the software scheduler achieves more than 97% of that of the hardware scheduler across workloads we consider. We further highlight the extensibility of the framework with a case study on fair queueing scheduling.