In this paper, the method of continously distributed dilocations is used to obtain the exact solutions of distribution functions D1(η) and D2(η) for single pileup of screw dislocations formed aginst an obstacle and double pileups of sorew dislocations between an inclusion and an obstacle under action of an applied stress while existing inhomogeneity. At the pileup tip near the obstacle, D1(η) and D2(η) have inverse square root singularity and D2(η) has-ω power singularity at pileup tip near the inclusion. The double pileups is used to represent the antiplane shear crack terminating at the interface of inclusion and the stress intensity factors are obtained. The solutions presented are valid for 02/G1<∞ and the results are discussed.