A computer-implemented method for allocation of thread resources in a multi-tenant environment comprising a multi-tenant database system which is an on-demand database service and in which data of a tenant is kept logically separate from that of other tenants, wherein each organization has one or more virtual queues that can be managed separately from other organizations, the method comprising: receiving job requests and bids from a plurality of the organizations over a network, wherein each job request and the corresponding bid is placed by a user via a user interface at a computing device over the network, wherein the user is associated with an organization, which organization is a tenant within the multi-tenant database system and has a resource currency balance assigned to it, the resource currency balance indicating how much resource currency the organization has in a currency reserve; enqueuing the job requests in the virtual queues associated with the corresponding organizations, determining resource currency values associated with pending jobs relating to the plurality of organizations, wherein the resource currency values thus determined correspond to resources dedicated to the pending jobs; performing an auction of the resources that are not dedicated and remains available for purchase based on the received bids, wherein a bid includes a purchase request to purchase the available resources, wherein performing the auction comprises determining, for each of said plurality of organizations, an amount of resources that can be purchased and allocating the determined amount of resources to each of said organizations; prioritizing the job requests based on the dedicated resources and the auction of the available resources, wherein it is determined for one or more organizations with a plurality of enqueued job requests which job type and how many jobs of each type are scheduled to run next, taking the queue state and priority preferences provided by the organization into account; and dequeuing and processing the job requests based on the prioritized job requests, wherein the amount of resource currency commensurate to the completed jobs of each organization is deducted from its resource currency balance. receiving job requests and bids from a plurality of the organizations over a network, wherein each job request and the corresponding bid is placed by a user via a user interface at a computing device over the network, wherein the user is associated with an organization, which organization is a tenant within the multi-tenant database system and has a resource currency balance assigned to it, the resource currency balance indicating how much resource currency the organization has in a currency reserve; enqueuing the job requests in the virtual queues associated with the corresponding organizations, determining resource currency values associated with pending jobs relating to the plurality of organizations, wherein the resource currency values thus determined correspond to resources dedicated to the pending jobs; performing an auction of the resources that are not dedicated and remains available for purchase based on the received bids, wherein a bid includes a purchase request to purchase the available resources, wherein performing the auction comprises determining, for each of said plurality of organizations, an amount of resources that can be purchased and allocating the determined amount of resources to each of said organizations; prioritizing the job requests based on the dedicated resources and the auction of the available resources, wherein it is determined for one or more organizations with a plurality of enqueued job requests which job type and how many jobs of each type are scheduled to run next, taking the queue state and priority preferences provided by the organization into account; and dequeuing and processing the job requests based on the prioritized job requests, wherein the amount of resource currency commensurate to the completed jobs of each organization is deducted from its resource currency balance.