Publish Your Invention
In theory, any reasonably-findable publication should work just as well as actually getting a patent in terms of establishing prior art to prevent the issuance of another patent on the invention.
Practice, however, is not always ideal. Judging from my experience patenting inventions, the patent examiners aren't always the best at finding relevant prior art and, even when they do, they don't always understand everything they're reading, regardless of how the prior art may have been published. At least in my experience, they also do tend to search the patent database more than other public publications.
If another patent does go into force on your invention, though, the only way for its owner to do anything with it is to sue someone. At this point, showing them that you have published prior art is likely to end any such enforcement attempt.
Check the USPTO Patent Application Database Routinely
Once you've published your invention (whether as a patent or not,) if you really want to be sure no other patent issues for your invention, the best way to do that is probably to periodically perform patent application searches yourself. USPTO's website allows you to search patent applications both by various metadata fields and by full-text.
Additionally, you can register for notifications when patent applications in areas of interest to you are filed. This may also help in identifying any attempts by someone else to patent your invention.
If your searches were to turn up a patent application that was attempting to patent your invention, you can submit a Third-Party Preissuance Submission to USPTO with the application number and your publications that demonstrate prior art. Depending on the number of documents you're submitting, though, this may incur a fee.