Distributed system has been developed as a platform for huge computations. Reliability is one of the prominent issues in such systems. Many studies have been recently done to improve reliability by proper task allocation in distributed systems, but they have only considered some system constraints such as processing load, memory capacity, and communication rate. In this paper, we consider time constraint in form of task deadline to above-mentioned constraints in order to model and analyze reliability in distributed real-time systems. To maximize reliability besides satisfying the constraints, we proposed a new offline task allocation algorithm. The algorithm is Systematic Memorybased Simulated Annealing (SMSA) which uses a monotonic cooling schedule and limited memory to store recently visited solutions to prevent cycling. In addition, an effective greedy heuristic algorithm intensifies SMSA. For evaluating the algorithm, SMSA is compared with Genetic Algorithm (GA) and Simulated Annealing (SA). Results have shown that in contrast to SA and GA, SMSA obtains satisfactory reliability in reasonable execution time. Meanwhile, SMSA meets all deadlines same as SA and GA. Furthermore, SMSA results have low deviation from average reliability.