On entanglements of flexible and rodlike polymers