Sawdust for Composting
First I would make sure the wood has not been chemically treated. Check a cross section of the wood for the distinctive ring of green color around the first half inch or so. If it has been chemically treated, it will contain chemicals like arsenic, chromium, and copper — not suitable for composting.
Make sure sawdust (and other carbon-rich "brown" materials) isn't more than about 80% of the material you are composting. That's just a basic guideline. You need some nitrogen-rich "green" material (living organics like leaves, fresh grass clippings, and other kitchen scraps) for decomposition.
Ideally, add the green materials and then spread sawdust on top of them.
Sawdust for Mulch
Sawdust is sometime recommended as an effective mulch for acid-loving plants (e.g. rhododendrons, begonias, impatiens, blueberries, etc), but for anything else, you will have to manage the acidifying effect as the sawdust decomposes. Wood chips and saw dust will rob soil of nitrogen as it decomposes, but since saw dust will decompose a lot faster, you may have to compensate the addition of nitrogen.
Keep in mind that saw dust can also compact severely over a single season, so you have to be sure to break it up periodically. Some people recommend a combination of straw and saw dust, but you have to watch for excessive water runoff nonetheless.