The authors propose a generalized architecture for an expert system to manage the resources of a computer network and/or a distributed system. The authors apply the proposed architecture to construct an expert system for allocating the resources needed by a task in a distributed computing environment. The resources are allocated such that the system load and the average delay of executing a task are optimized. The authors present an approach to evaluate the average delay incurred during the execution of a distributed task that requires the cooperation of several computers. These computers and their resources are distributed over the network. The resources needed for the execution of a task are allocated such that system load and the task delay incurred during its execution are optimized.