A theory of resource sharing in a mixed system with hard real-time and non-real-time processing requirements is presented. The real-time processing is modeled as rate-based execution (RBE) tasks whose resource needs are known in advance. The non-real-time processing is modeled as aperiodic requests and dynamically mapped to weight-based variable rate execution tasks. The resource sharing requirements of the aperiodic requests are unknown a priori and only become known when a critical section is reached. A scheduling algorithm that supports resource sharing without deadlock in such a mixed system is presented with a sufficient off-line schedulability condition.