Patterns of codon usage bias (CUB) convey useful information about the selection on synonymous codons induced by gene expression and contribute to an understanding of substitution patterns observed at synonymous sites. They can also be informative about the distinctive evolutionary properties of sex chromosomes such as genetic degeneration of the Y chromosome, dosage compensation, and hemizygosity of the X chromosome in males, which can affect the selection on codon usage. Here, we study CUB in Silene latifolia, a species of interest for studying the early stages of sex chromosome evolution. We have obtained a large expressed sequence tag data set containing more than 1,608 sequence fragments by 454 sequencing. Using three different methods, we conservatively define 21 preferred codons. Interestingly, the preferred codons in S. latifolia are almost identical to those in Arabidopsis thaliana, despite their long divergence time (we estimate average nonsynonymous site divergence to be 0.216, and synonymous sites are saturated). The agreement suggests that the nature of selection on codon usage has not changed significantly during the long evolutionary time separating the two species. As in many other organisms, the frequency of preferred codons is negatively correlated with protein length. For the 43 genes with both exon and intron sequences, we find a positive correlation between gene expression levels and GC content at third codon positions, but a strong negative correlation between expression and intron GC content, suggesting that the CUB we detect in S. latifolia is more likely to be due to natural selection than to mutational bias. Using polymorphism data, we detect evidence of ongoing natural selection on CUB, but we find little support for effects of biased gene conversion. An analysis of ten sex-linked genes reveals that the X chromosome has experienced significantly more unpreferred to preferred than preferred to unpreferred substitutions, suggesting that it may be evolving higher CUB. In contrast, numbers of substitutions between preferred and unpreferred codons are similar in both directions in the Y-linked genes, contrary to the expectation of genetic degeneration.