Queues and Inventories: A Study of Their Basic Stochastic Processes