I never set a wood post in concrete. When the concrete cures it pulls away from the post slightly and moisture gets between the concrete and the wood. The post will rot out in a short period of time. Even creosote treated rail road ties will rot quicker with concrete around them. Wood posts should be set with dirt or gravel tamped down around them. Come up in about 4 to 6 inch lifts and tamp down with a tamping bar.
Pipe can be set in concrete and that works very well. As others have said, the corner posts or stretch posts need additional bracing, either H braces or angle braces.