The hike up Mount Osceola was a very steady grade and a relatively easy 3.2 miles. Unfortunately, the partly sunny forecast did not pan out as we were completely in a cloud when we reached the summit and had no views. We continued on for another 1.0 mile with a couple of very steep sections over to the summit of East Osceola which had a wooded summit in the clouds. We retraced our steps back to the car and had completed 4000 footers 18 and 19 by 12:45PM. Overall it was an enjoyable hike that was part of just a generally really nice time away in New Hampshire.
July 14, 2011
Mount Osceola and East Osceola
The hike up Mount Osceola was a very steady grade and a relatively easy 3.2 miles. Unfortunately, the partly sunny forecast did not pan out as we were completely in a cloud when we reached the summit and had no views. We continued on for another 1.0 mile with a couple of very steep sections over to the summit of East Osceola which had a wooded summit in the clouds. We retraced our steps back to the car and had completed 4000 footers 18 and 19 by 12:45PM. Overall it was an enjoyable hike that was part of just a generally really nice time away in New Hampshire.
Labels:
4000 Footers
,
Hiking
July 4, 2011
The Wildcat-Carter Traverse
Whenever you do a long, end-to-end hike like this one, it's often tricky because you need to coordinate dropping a second car off at one end of the hike. Fortunately, Brian, Kate, and UP were willing to come along with us up the first peak (Wildcat D), and help us spot a car at the other end of the trek. (In fact, Mo was not originally planning on coming the entire 15 miles with us, but she changed her mind a mile into the hike and rather than turning around to return with the other group, decided to continue on with Katy and me). All six of us were up at 5:30AM and left the condo at 6:30AM to make our way out to the hike. We had two cars so we dropped Mo and UP off at the Wildcat Ridge trailhead and we continued on to the Imp trailhead to drop off our car. Brian brought Katy and I back to the Wildcat Ridge trailhead, and all six of us began our trek up at about 7AM.
This was a long and challenging hike but it was a perfect day for it and well worth it. Single day Presidential Traverse? Perhaps it is in our future.
Labels:
4000 Footers
,
Hiking
May 29, 2011
North and South Hancock
Overall it was a fun trip to put the total number of 4000 footers for Katy and I up to 12. We headed back to Massachusetts and stopped for pizza on the way back. We also learned on the way back that my sister Megan got engaged to her longtime boyfriend Chris while we were hiking! Congratulations to Megan and Chris!
Labels:
4000 Footers
,
Hiking
October 13, 2010
Mounts Tom, Field, and Willey
Since we were spending the weekend with several other family members at AL and UP's condo, I had thought we would get a few more takers to join us this time around. But alas, most were dissuaded by the early wakeup call and the hefty mileage. Only Katy, myself, and Mo were motivated enough to be out the door and heading to the trailhead in Crawford Notch at 7:45AM. By 8:30AM we were geared up and on the trail under perfectly clear skies but very crisp fall air in the mid 30's.
Labels:
4000 Footers
,
Hiking
,
Personal
September 5, 2010
The Kinsmans
Since Labor Day weekend is always a popular time for hiking in the White Mountains, we were hoping to get an early start. The route we selected to climb the Kinsmans starts at the Lafayette Place campground which is also the trailhead for the loop trail up Mounts Lafayette and Lincoln, one of the most popular hikes in all of New England. The lot was filling up quickly when we arrived at 8:30AM, but we easily found a spot and were geared up and on the trail at about 8:45AM. The weather was partly cloudy and in the upper 50s at the trailhead, and the forecast looked pretty reasonable for the rest of the day with only a slight chance of a shower. We were off.
We arrived back at the car after our knee pounding descent at about 4:15PM, seven and a half hours total for the ten miler. Overall it was a great day and fun to bring Anne and Mo out for their first two 4000 footers! And finally, proof that Katy and I made it up North Kinsman, and South Kinsman.
Labels:
4000 Footers
,
Hiking
,
Personal
July 27, 2010
Mount Moriah
With a busy rest of the summer ahead of us, it was good to get another mountain done. Hopefully we'll find some time in the superior hiking months of September and October to knock off a few more!
Labels:
4000 Footers
,
Hiking
,
Personal
July 20, 2010
Future Interrupted
I always thought of Java's Future interface as a fairly elegant and effective way of dealing with asynchronous tasks. It's lightweight, gives you a mechanism to check if a task is finished, allows you to block until the task completes and retrieve its result, and also provides a hook to attempt to cancel the task via interruption. When used in conjunction with the various thread pool services in
Yesterday, though, I discovered a subtle distinction about the semantic behavior of the
Essentially, call
The worst part about this is that it is not immediately clear from the javadoc for the Future interface that this is the actual behavior. The description of the
I struggled for a bit to come up with a reasonable alternative mechanism for accomplishing this behavior short of re-implementing my own thread pool and managing the threads myself. Fortunately, after speaking with a colleague, I was pointed to the beforeExecute and afterExecute hooks on the
Anyhow, that's my tidbit for the day. Be careful when playing with the
java.util.concurrent package, it becomes a simple, yet powerful tool.Yesterday, though, I discovered a subtle distinction about the semantic behavior of the
Future interface that slightly diminishes its power. I found myself in a situation where I wanted to cancel a Future, but then still wait until its associated task has completed. Initially I thought this might be accomplished with something like this: // send an interrupt to the task's thread
future.cancel(true);
// block until the task is complete
boolean finished = false;
boolean interrupted = false;
while (!finished) {
try {
future.get();
finished = true;
} catch (CancellationException ce) {
// task has been cancelled, handle appropriately
finished = true;
} catch (ExecutionException ee) {
// task completed with error, handle appropriately
finished = true;
} catch (InterruptedException ie) {
// current thread has been interrupted, record and continue
interrupted = true;
}
}
// re-interrupt this thread if we've been interrupted
if (interrupted) {
Thread.currentThread().interrupt();
}
Essentially, call
cancel(true) on the Future in order to send an interrupt to the associated task's thread. Then call get() on the Future in a loop to ensure that the task has properly handled the interruption and completed execution before proceeding. However, the above code does not work as expected. The problem is that once you call cancel() on a Future, the task's thread will be sent an interrupt if it is running, but then the state associated with the task is completely cast aside. Subsequent calls to get() on the same Future will always immediately throw a CancellationException and there is no available mechanism to block until the task's thread has completed handling the interruption and finished its execution.The worst part about this is that it is not immediately clear from the javadoc for the Future interface that this is the actual behavior. The description of the
cancel() method is very clear that if the task has not started, it will prevent it from starting, but if it has already started, it can make an attempt to "cancel" it via interruption of the task's thread. Of course, since in Java interrupting a thread is only a suggestion for it to actually stop what it's doing, there's no guarantee about when or if the task will actually stop unless you handle the interruption properly. Therefore, I hoped that calling get() would wait for the computation to complete, and then throw a CancellationException if the thread was interrupted. After testing it and also digging through the Java source code for the Future implementation, I discovered that that is definitely not the case.I struggled for a bit to come up with a reasonable alternative mechanism for accomplishing this behavior short of re-implementing my own thread pool and managing the threads myself. Fortunately, after speaking with a colleague, I was pointed to the beforeExecute and afterExecute hooks on the
ThreadPoolExecutor. It takes a little more work then I had hoped, but using those hooks allows you to augment the functionality of ThreadPoolExecutor to achieve this type of behavior. I'll leave the details of it up to you.Anyhow, that's my tidbit for the day. Be careful when playing with the
Future!
Labels:
Tech
Subscribe to:
Posts
(
Atom
)