Run main thread blocks from a background thread