In a patent thicket licensing provides a mechanism to either avoid or resolve hold-up. Firms' R&D incentives will differ depending on how licensing is used. In this paper we study the choice between ex ante licensing to avoid hold-up and ex post licensing to resolve it. Building on a theoretical model of a patent portfolio race, firms' choices of licensing contracts are modelled. We derive several hypotheses from the model and find support for these using data from the semiconductor industry. The empirical results show that firms' relationships in product markets and technology space jointly determine the type of licensing contract chosen. Implications for the regulation of licensing are discussed. We estimate a dynamic panel data model wit...