Merge branch 'master' of github.com:grpc/grpc into cq_alarm
diff --git a/include/grpc++/alarm.h b/include/grpc++/alarm.h
new file mode 100644
index 0000000..8cf7f59
--- /dev/null
+++ b/include/grpc++/alarm.h
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/// An Alarm posts the user provided tag to its associated completion queue upon
+/// expiry or cancellation.
+#ifndef GRPCXX_ALARM_H
+#define GRPCXX_ALARM_H
+
+#include <grpc++/completion_queue.h>
+#include <grpc++/impl/grpc_library.h>
+#include <grpc++/support/time.h>
+
+namespace grpc {
+
+/// A thin wrapper around \a grpc_alarm (see / \a / src/core/surface/alarm.h).
+class Alarm: public GrpcLibrary {
+ public:
+  /// Create a completion queue alarm instance associated to \a cq.
+  ///
+  /// Once the alarm expires (at \a deadline) or it's cancelled (see \a Cancel),
+  /// an event with tag \a tag will be added to \a cq. If the alarm expired, the
+  /// event's success bit will be true, false otherwise (ie, upon cancellation).
+  Alarm(CompletionQueue* cq, gpr_timespec deadline, void* tag);
+
+  /// Destroy the given completion queue alarm, cancelling it in the process.
+  ~Alarm();
+
+  /// Cancel a completion queue alarm. Calling this function over an alarm that
+  /// has already fired has no effect.
+  void Cancel();
+
+ private:
+  grpc_alarm* const alarm_;  // owned
+};
+
+}  // namespace grpc
+
+#endif  // GRPCXX_ALARM_H
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 0c854a5..191ad5d 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -56,6 +56,9 @@
     actions. */
 typedef struct grpc_completion_queue grpc_completion_queue;
 
+/** An alarm associated with a completion queue. */
+typedef struct grpc_alarm grpc_alarm;
+
 /** The Channel interface allows creation of Call objects. */
 typedef struct grpc_channel grpc_channel;
 
@@ -475,6 +478,22 @@
     drained and no threads are executing grpc_completion_queue_next */
 void grpc_completion_queue_destroy(grpc_completion_queue *cq);
 
+/** Create a completion queue alarm instance associated to \a cq.
+ *
+ * Once the alarm expires (at \a deadline) or it's cancelled (see \a
+ * grpc_alarm_cancel), an event with tag \a tag will be added to \a cq. If the
+ * alarm expired, the event's success bit will be true, false otherwise (ie,
+ * upon cancellation). */
+grpc_alarm *grpc_alarm_create(grpc_completion_queue *cq, gpr_timespec deadline,
+                              void *tag);
+
+/** Cancel a completion queue alarm. Calling this function over an alarm that
+ * has already fired has no effect. */
+void grpc_alarm_cancel(grpc_alarm *alarm);
+
+/** Destroy the given completion queue alarm, cancelling it in the process. */
+void grpc_alarm_destroy(grpc_alarm *alarm);
+
 /** Check the connectivity state of a channel. */
 grpc_connectivity_state grpc_channel_check_connectivity_state(
     grpc_channel *channel, int try_to_connect);
diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c
index 5e84dec..095000b 100644
--- a/src/core/client_config/subchannel.c
+++ b/src/core/client_config/subchannel.c
@@ -40,7 +40,7 @@
 #include "src/core/channel/channel_args.h"
 #include "src/core/channel/client_channel.h"
 #include "src/core/channel/connected_channel.h"
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/transport/connectivity_state.h"
 #include "src/core/surface/channel.h"
 
@@ -130,7 +130,7 @@
   /** do we have an active alarm? */
   int have_alarm;
   /** our alarm */
-  grpc_alarm alarm;
+  grpc_timer alarm;
   /** current random value */
   gpr_uint32 random;
 };
@@ -462,7 +462,7 @@
   }
 
   if (cancel_alarm) {
-    grpc_alarm_cancel(exec_ctx, &c->alarm);
+    grpc_timer_cancel(exec_ctx, &c->alarm);
   }
 
   if (op->disconnect) {
@@ -693,7 +693,7 @@
     GPR_ASSERT(!c->have_alarm);
     c->have_alarm = 1;
     connectivity_state_changed_locked(exec_ctx, c, "connect_failed");
-    grpc_alarm_init(exec_ctx, &c->alarm, c->next_attempt, on_alarm, c, now);
+    grpc_timer_init(exec_ctx, &c->alarm, c->next_attempt, on_alarm, c, now);
     gpr_mu_unlock(&c->mu);
   }
 }
diff --git a/src/core/iomgr/iocp_windows.c b/src/core/iomgr/iocp_windows.c
index cebd863..65da3a9 100644
--- a/src/core/iomgr/iocp_windows.c
+++ b/src/core/iomgr/iocp_windows.c
@@ -42,7 +42,7 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/thd.h>
 
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/socket_windows.h"
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index e61fc32..212ce55 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -43,7 +43,7 @@
 #include <grpc/support/thd.h>
 
 #include "src/core/iomgr/iomgr_internal.h"
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_internal.h"
 #include "src/core/support/string.h"
 
 static gpr_mu g_mu;
@@ -55,7 +55,7 @@
   g_shutdown = 0;
   gpr_mu_init(&g_mu);
   gpr_cv_init(&g_rcv);
-  grpc_alarm_list_init(gpr_now(GPR_CLOCK_MONOTONIC));
+  grpc_timer_list_init(gpr_now(GPR_CLOCK_MONOTONIC));
   g_root_object.next = g_root_object.prev = &g_root_object;
   g_root_object.name = "root";
   grpc_iomgr_platform_init();
@@ -98,7 +98,7 @@
       }
       last_warning_time = gpr_now(GPR_CLOCK_REALTIME);
     }
-    if (grpc_alarm_check(&exec_ctx, gpr_inf_future(GPR_CLOCK_MONOTONIC),
+    if (grpc_timer_check(&exec_ctx, gpr_inf_future(GPR_CLOCK_MONOTONIC),
                          NULL)) {
       gpr_mu_unlock(&g_mu);
       grpc_exec_ctx_flush(&exec_ctx);
@@ -124,7 +124,7 @@
   }
   gpr_mu_unlock(&g_mu);
 
-  grpc_alarm_list_shutdown(&exec_ctx);
+  grpc_timer_list_shutdown(&exec_ctx);
   grpc_exec_ctx_finish(&exec_ctx);
 
   /* ensure all threads have left g_mu */
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index 4d8bc53..c4e1987 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -42,7 +42,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/fd_posix.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/socket_utils_posix.h"
@@ -255,7 +255,7 @@
      each time through on every pollset.
      May update deadline to ensure timely wakeups.
      TODO(ctiller): can this work be localized? */
-  if (grpc_alarm_check(exec_ctx, now, &deadline)) {
+  if (grpc_timer_check(exec_ctx, now, &deadline)) {
     gpr_mu_unlock(&pollset->mu);
     locked = 0;
     goto done;
diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c
index 96abaea..9f74580 100644
--- a/src/core/iomgr/pollset_windows.c
+++ b/src/core/iomgr/pollset_windows.c
@@ -37,7 +37,7 @@
 
 #include <grpc/support/thd.h>
 
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/pollset.h"
@@ -136,7 +136,7 @@
   worker->kicked = 0;
   worker->pollset = pollset;
   gpr_cv_init(&worker->cv);
-  if (grpc_alarm_check(exec_ctx, now, &deadline)) {
+  if (grpc_timer_check(exec_ctx, now, &deadline)) {
     goto done;
   }
   if (!pollset->kicked_without_pollers && !pollset->shutting_down) {
diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c
index fe20039..abd6315 100644
--- a/src/core/iomgr/tcp_client_posix.c
+++ b/src/core/iomgr/tcp_client_posix.c
@@ -42,7 +42,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/iomgr/iomgr_posix.h"
 #include "src/core/iomgr/pollset_posix.h"
 #include "src/core/iomgr/sockaddr_utils.h"
@@ -60,7 +60,7 @@
   gpr_mu mu;
   grpc_fd *fd;
   gpr_timespec deadline;
-  grpc_alarm alarm;
+  grpc_timer alarm;
   int refs;
   grpc_closure write_closure;
   grpc_pollset_set *interested_parties;
@@ -132,7 +132,7 @@
   ac->fd = NULL;
   gpr_mu_unlock(&ac->mu);
 
-  grpc_alarm_cancel(exec_ctx, &ac->alarm);
+  grpc_timer_cancel(exec_ctx, &ac->alarm);
 
   gpr_mu_lock(&ac->mu);
   if (success) {
@@ -290,7 +290,7 @@
   }
 
   gpr_mu_lock(&ac->mu);
-  grpc_alarm_init(exec_ctx, &ac->alarm,
+  grpc_timer_init(exec_ctx, &ac->alarm,
                   gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC),
                   tc_on_alarm, ac, gpr_now(GPR_CLOCK_MONOTONIC));
   grpc_fd_notify_on_write(exec_ctx, ac->fd, &ac->write_closure);
diff --git a/src/core/iomgr/tcp_client_windows.c b/src/core/iomgr/tcp_client_windows.c
index 3540c55..e5691b7 100644
--- a/src/core/iomgr/tcp_client_windows.c
+++ b/src/core/iomgr/tcp_client_windows.c
@@ -43,7 +43,7 @@
 #include <grpc/support/slice_buffer.h>
 #include <grpc/support/useful.h>
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/tcp_client.h"
 #include "src/core/iomgr/tcp_windows.h"
@@ -56,7 +56,7 @@
   gpr_mu mu;
   grpc_winsocket *socket;
   gpr_timespec deadline;
-  grpc_alarm alarm;
+  grpc_timer alarm;
   char *addr_name;
   int refs;
   grpc_closure on_connect;
@@ -91,7 +91,7 @@
   grpc_winsocket_callback_info *info = &ac->socket->write_info;
   grpc_closure *on_done = ac->on_done;
 
-  grpc_alarm_cancel(exec_ctx, &ac->alarm);
+  grpc_timer_cancel(exec_ctx, &ac->alarm);
 
   gpr_mu_lock(&ac->mu);
 
@@ -201,7 +201,7 @@
   ac->endpoint = endpoint;
   grpc_closure_init(&ac->on_connect, on_connect, ac);
 
-  grpc_alarm_init(exec_ctx, &ac->alarm, deadline, on_alarm, ac,
+  grpc_timer_init(exec_ctx, &ac->alarm, deadline, on_alarm, ac,
                   gpr_now(GPR_CLOCK_MONOTONIC));
   grpc_socket_notify_on_write(exec_ctx, socket, &ac->on_connect);
   return;
diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c
index 9ceffca..5ff7823 100644
--- a/src/core/iomgr/tcp_windows.c
+++ b/src/core/iomgr/tcp_windows.c
@@ -44,7 +44,7 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/sockaddr.h"
 #include "src/core/iomgr/sockaddr_utils.h"
diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/timer.c
similarity index 67%
rename from src/core/iomgr/alarm.c
rename to src/core/iomgr/timer.c
index 0ba5361..66fafe7 100644
--- a/src/core/iomgr/alarm.c
+++ b/src/core/iomgr/timer.c
@@ -31,10 +31,10 @@
  *
  */
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 
-#include "src/core/iomgr/alarm_heap.h"
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_heap.h"
+#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/time_averaged_stats.h"
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
@@ -51,37 +51,37 @@
 typedef struct {
   gpr_mu mu;
   grpc_time_averaged_stats stats;
-  /* All and only alarms with deadlines <= this will be in the heap. */
+  /* All and only timers with deadlines <= this will be in the heap. */
   gpr_timespec queue_deadline_cap;
   gpr_timespec min_deadline;
   /* Index in the g_shard_queue */
   gpr_uint32 shard_queue_index;
-  /* This holds all alarms with deadlines < queue_deadline_cap.  Alarms in this
+  /* This holds all timers with deadlines < queue_deadline_cap. Timers in this
      list have the top bit of their deadline set to 0. */
-  grpc_alarm_heap heap;
-  /* This holds alarms whose deadline is >= queue_deadline_cap. */
-  grpc_alarm list;
+  grpc_timer_heap heap;
+  /* This holds timers whose deadline is >= queue_deadline_cap. */
+  grpc_timer list;
 } shard_type;
 
 /* Protects g_shard_queue */
 static gpr_mu g_mu;
-/* Allow only one run_some_expired_alarms at once */
+/* Allow only one run_some_expired_timers at once */
 static gpr_mu g_checker_mu;
 static gpr_clock_type g_clock_type;
 static shard_type g_shards[NUM_SHARDS];
 /* Protected by g_mu */
 static shard_type *g_shard_queue[NUM_SHARDS];
 
-static int run_some_expired_alarms(grpc_exec_ctx *exec_ctx, gpr_timespec now,
+static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now,
                                    gpr_timespec *next, int success);
 
 static gpr_timespec compute_min_deadline(shard_type *shard) {
-  return grpc_alarm_heap_is_empty(&shard->heap)
+  return grpc_timer_heap_is_empty(&shard->heap)
              ? shard->queue_deadline_cap
-             : grpc_alarm_heap_top(&shard->heap)->deadline;
+             : grpc_timer_heap_top(&shard->heap)->deadline;
 }
 
-void grpc_alarm_list_init(gpr_timespec now) {
+void grpc_timer_list_init(gpr_timespec now) {
   gpr_uint32 i;
 
   gpr_mu_init(&g_mu);
@@ -95,27 +95,27 @@
                                   0.5);
     shard->queue_deadline_cap = now;
     shard->shard_queue_index = i;
-    grpc_alarm_heap_init(&shard->heap);
+    grpc_timer_heap_init(&shard->heap);
     shard->list.next = shard->list.prev = &shard->list;
     shard->min_deadline = compute_min_deadline(shard);
     g_shard_queue[i] = shard;
   }
 }
 
-void grpc_alarm_list_shutdown(grpc_exec_ctx *exec_ctx) {
+void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx) {
   int i;
-  run_some_expired_alarms(exec_ctx, gpr_inf_future(g_clock_type), NULL, 0);
+  run_some_expired_timers(exec_ctx, gpr_inf_future(g_clock_type), NULL, 0);
   for (i = 0; i < NUM_SHARDS; i++) {
     shard_type *shard = &g_shards[i];
     gpr_mu_destroy(&shard->mu);
-    grpc_alarm_heap_destroy(&shard->heap);
+    grpc_timer_heap_destroy(&shard->heap);
   }
   gpr_mu_destroy(&g_mu);
   gpr_mu_destroy(&g_checker_mu);
 }
 
 /* This is a cheap, but good enough, pointer hash for sharding the tasks: */
-static size_t shard_idx(const grpc_alarm *info) {
+static size_t shard_idx(const grpc_timer *info) {
   size_t x = (size_t)info;
   return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) & (NUM_SHARDS - 1);
 }
@@ -132,15 +132,15 @@
   return ts;
 }
 
-static void list_join(grpc_alarm *head, grpc_alarm *alarm) {
-  alarm->next = head;
-  alarm->prev = head->prev;
-  alarm->next->prev = alarm->prev->next = alarm;
+static void list_join(grpc_timer *head, grpc_timer *timer) {
+  timer->next = head;
+  timer->prev = head->prev;
+  timer->next->prev = timer->prev->next = timer;
 }
 
-static void list_remove(grpc_alarm *alarm) {
-  alarm->next->prev = alarm->prev;
-  alarm->prev->next = alarm->next;
+static void list_remove(grpc_timer *timer) {
+  timer->next->prev = timer->prev;
+  timer->prev->next = timer->next;
 }
 
 static void swap_adjacent_shards_in_queue(gpr_uint32 first_shard_queue_index) {
@@ -170,16 +170,16 @@
   }
 }
 
-void grpc_alarm_init(grpc_exec_ctx *exec_ctx, grpc_alarm *alarm,
-                     gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb,
-                     void *alarm_cb_arg, gpr_timespec now) {
-  int is_first_alarm = 0;
-  shard_type *shard = &g_shards[shard_idx(alarm)];
+void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
+                     gpr_timespec deadline, grpc_iomgr_cb_func timer_cb,
+                     void *timer_cb_arg, gpr_timespec now) {
+  int is_first_timer = 0;
+  shard_type *shard = &g_shards[shard_idx(timer)];
   GPR_ASSERT(deadline.clock_type == g_clock_type);
   GPR_ASSERT(now.clock_type == g_clock_type);
-  grpc_closure_init(&alarm->closure, alarm_cb, alarm_cb_arg);
-  alarm->deadline = deadline;
-  alarm->triggered = 0;
+  grpc_closure_init(&timer->closure, timer_cb, timer_cb_arg);
+  timer->deadline = deadline;
+  timer->triggered = 0;
 
   /* TODO(ctiller): check deadline expired */
 
@@ -187,25 +187,25 @@
   grpc_time_averaged_stats_add_sample(&shard->stats,
                                       ts_to_dbl(gpr_time_sub(deadline, now)));
   if (gpr_time_cmp(deadline, shard->queue_deadline_cap) < 0) {
-    is_first_alarm = grpc_alarm_heap_add(&shard->heap, alarm);
+    is_first_timer = grpc_timer_heap_add(&shard->heap, timer);
   } else {
-    alarm->heap_index = INVALID_HEAP_INDEX;
-    list_join(&shard->list, alarm);
+    timer->heap_index = INVALID_HEAP_INDEX;
+    list_join(&shard->list, timer);
   }
   gpr_mu_unlock(&shard->mu);
 
   /* Deadline may have decreased, we need to adjust the master queue.  Note
      that there is a potential racy unlocked region here.  There could be a
-     reordering of multiple grpc_alarm_init calls, at this point, but the < test
+     reordering of multiple grpc_timer_init calls, at this point, but the < test
      below should ensure that we err on the side of caution.  There could
-     also be a race with grpc_alarm_check, which might beat us to the lock.  In
-     that case, it is possible that the alarm that we added will have already
+     also be a race with grpc_timer_check, which might beat us to the lock.  In
+     that case, it is possible that the timer that we added will have already
      run by the time we hold the lock, but that too is a safe error.
-     Finally, it's possible that the grpc_alarm_check that intervened failed to
-     trigger the new alarm because the min_deadline hadn't yet been reduced.
-     In that case, the alarm will simply have to wait for the next
-     grpc_alarm_check. */
-  if (is_first_alarm) {
+     Finally, it's possible that the grpc_timer_check that intervened failed to
+     trigger the new timer because the min_deadline hadn't yet been reduced.
+     In that case, the timer will simply have to wait for the next
+     grpc_timer_check. */
+  if (is_first_timer) {
     gpr_mu_lock(&g_mu);
     if (gpr_time_cmp(deadline, shard->min_deadline) < 0) {
       gpr_timespec old_min_deadline = g_shard_queue[0]->min_deadline;
@@ -220,16 +220,16 @@
   }
 }
 
-void grpc_alarm_cancel(grpc_exec_ctx *exec_ctx, grpc_alarm *alarm) {
-  shard_type *shard = &g_shards[shard_idx(alarm)];
+void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) {
+  shard_type *shard = &g_shards[shard_idx(timer)];
   gpr_mu_lock(&shard->mu);
-  if (!alarm->triggered) {
-    grpc_exec_ctx_enqueue(exec_ctx, &alarm->closure, 0);
-    alarm->triggered = 1;
-    if (alarm->heap_index == INVALID_HEAP_INDEX) {
-      list_remove(alarm);
+  if (!timer->triggered) {
+    grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, 0);
+    timer->triggered = 1;
+    if (timer->heap_index == INVALID_HEAP_INDEX) {
+      list_remove(timer);
     } else {
-      grpc_alarm_heap_remove(&shard->heap, alarm);
+      grpc_timer_heap_remove(&shard->heap, timer);
     }
   }
   gpr_mu_unlock(&shard->mu);
@@ -237,7 +237,7 @@
 
 /* This is called when the queue is empty and "now" has reached the
    queue_deadline_cap.  We compute a new queue deadline and then scan the map
-   for alarms that fall at or under it.  Returns true if the queue is no
+   for timers that fall at or under it.  Returns true if the queue is no
    longer empty.
    REQUIRES: shard->mu locked */
 static int refill_queue(shard_type *shard, gpr_timespec now) {
@@ -248,49 +248,49 @@
   double deadline_delta =
       GPR_CLAMP(computed_deadline_delta, MIN_QUEUE_WINDOW_DURATION,
                 MAX_QUEUE_WINDOW_DURATION);
-  grpc_alarm *alarm, *next;
+  grpc_timer *timer, *next;
 
-  /* Compute the new cap and put all alarms under it into the queue: */
+  /* Compute the new cap and put all timers under it into the queue: */
   shard->queue_deadline_cap = gpr_time_add(
       gpr_time_max(now, shard->queue_deadline_cap), dbl_to_ts(deadline_delta));
-  for (alarm = shard->list.next; alarm != &shard->list; alarm = next) {
-    next = alarm->next;
+  for (timer = shard->list.next; timer != &shard->list; timer = next) {
+    next = timer->next;
 
-    if (gpr_time_cmp(alarm->deadline, shard->queue_deadline_cap) < 0) {
-      list_remove(alarm);
-      grpc_alarm_heap_add(&shard->heap, alarm);
+    if (gpr_time_cmp(timer->deadline, shard->queue_deadline_cap) < 0) {
+      list_remove(timer);
+      grpc_timer_heap_add(&shard->heap, timer);
     }
   }
-  return !grpc_alarm_heap_is_empty(&shard->heap);
+  return !grpc_timer_heap_is_empty(&shard->heap);
 }
 
-/* This pops the next non-cancelled alarm with deadline <= now from the queue,
+/* This pops the next non-cancelled timer with deadline <= now from the queue,
    or returns NULL if there isn't one.
    REQUIRES: shard->mu locked */
-static grpc_alarm *pop_one(shard_type *shard, gpr_timespec now) {
-  grpc_alarm *alarm;
+static grpc_timer *pop_one(shard_type *shard, gpr_timespec now) {
+  grpc_timer *timer;
   for (;;) {
-    if (grpc_alarm_heap_is_empty(&shard->heap)) {
+    if (grpc_timer_heap_is_empty(&shard->heap)) {
       if (gpr_time_cmp(now, shard->queue_deadline_cap) < 0) return NULL;
       if (!refill_queue(shard, now)) return NULL;
     }
-    alarm = grpc_alarm_heap_top(&shard->heap);
-    if (gpr_time_cmp(alarm->deadline, now) > 0) return NULL;
-    alarm->triggered = 1;
-    grpc_alarm_heap_pop(&shard->heap);
-    return alarm;
+    timer = grpc_timer_heap_top(&shard->heap);
+    if (gpr_time_cmp(timer->deadline, now) > 0) return NULL;
+    timer->triggered = 1;
+    grpc_timer_heap_pop(&shard->heap);
+    return timer;
   }
 }
 
 /* REQUIRES: shard->mu unlocked */
-static size_t pop_alarms(grpc_exec_ctx *exec_ctx, shard_type *shard,
+static size_t pop_timers(grpc_exec_ctx *exec_ctx, shard_type *shard,
                          gpr_timespec now, gpr_timespec *new_min_deadline,
                          int success) {
   size_t n = 0;
-  grpc_alarm *alarm;
+  grpc_timer *timer;
   gpr_mu_lock(&shard->mu);
-  while ((alarm = pop_one(shard, now))) {
-    grpc_exec_ctx_enqueue(exec_ctx, &alarm->closure, success);
+  while ((timer = pop_one(shard, now))) {
+    grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, success);
     n++;
   }
   *new_min_deadline = compute_min_deadline(shard);
@@ -298,11 +298,11 @@
   return n;
 }
 
-static int run_some_expired_alarms(grpc_exec_ctx *exec_ctx, gpr_timespec now,
+static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now,
                                    gpr_timespec *next, int success) {
   size_t n = 0;
 
-  /* TODO(ctiller): verify that there are any alarms (atomically) here */
+  /* TODO(ctiller): verify that there are any timers (atomically) here */
 
   if (gpr_mu_trylock(&g_checker_mu)) {
     gpr_mu_lock(&g_mu);
@@ -310,16 +310,16 @@
     while (gpr_time_cmp(g_shard_queue[0]->min_deadline, now) < 0) {
       gpr_timespec new_min_deadline;
 
-      /* For efficiency, we pop as many available alarms as we can from the
-         shard.  This may violate perfect alarm deadline ordering, but that
+      /* For efficiency, we pop as many available timers as we can from the
+         shard.  This may violate perfect timer deadline ordering, but that
          shouldn't be a big deal because we don't make ordering guarantees. */
-      n += pop_alarms(exec_ctx, g_shard_queue[0], now, &new_min_deadline,
+      n += pop_timers(exec_ctx, g_shard_queue[0], now, &new_min_deadline,
                       success);
 
-      /* An grpc_alarm_init() on the shard could intervene here, adding a new
-         alarm that is earlier than new_min_deadline.  However,
-         grpc_alarm_init() will block on the master_lock before it can call
-         set_min_deadline, so this one will complete first and then the AddAlarm
+      /* An grpc_timer_init() on the shard could intervene here, adding a new
+         timer that is earlier than new_min_deadline.  However,
+         grpc_timer_init() will block on the master_lock before it can call
+         set_min_deadline, so this one will complete first and then the Addtimer
          will reduce the min_deadline (perhaps unnecessarily). */
       g_shard_queue[0]->min_deadline = new_min_deadline;
       note_deadline_change(g_shard_queue[0]);
@@ -336,15 +336,15 @@
   return (int)n;
 }
 
-int grpc_alarm_check(grpc_exec_ctx *exec_ctx, gpr_timespec now,
+int grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now,
                      gpr_timespec *next) {
   GPR_ASSERT(now.clock_type == g_clock_type);
-  return run_some_expired_alarms(
+  return run_some_expired_timers(
       exec_ctx, now, next,
       gpr_time_cmp(now, gpr_inf_future(now.clock_type)) != 0);
 }
 
-gpr_timespec grpc_alarm_list_next_timeout(void) {
+gpr_timespec grpc_timer_list_next_timeout(void) {
   gpr_timespec out;
   gpr_mu_lock(&g_mu);
   out = g_shard_queue[0]->min_deadline;
diff --git a/src/core/iomgr/alarm.h b/src/core/iomgr/timer.h
similarity index 68%
rename from src/core/iomgr/alarm.h
rename to src/core/iomgr/timer.h
index 94f9bc1..9abe581 100644
--- a/src/core/iomgr/alarm.h
+++ b/src/core/iomgr/timer.h
@@ -31,59 +31,59 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_H
-#define GRPC_INTERNAL_CORE_IOMGR_ALARM_H
+#ifndef GRPC_INTERNAL_CORE_IOMGR_TIMER_H
+#define GRPC_INTERNAL_CORE_IOMGR_TIMER_H
 
 #include "src/core/iomgr/iomgr.h"
 #include "src/core/iomgr/exec_ctx.h"
 #include <grpc/support/port_platform.h>
 #include <grpc/support/time.h>
 
-typedef struct grpc_alarm {
+typedef struct grpc_timer {
   gpr_timespec deadline;
   gpr_uint32 heap_index; /* INVALID_HEAP_INDEX if not in heap */
   int triggered;
-  struct grpc_alarm *next;
-  struct grpc_alarm *prev;
+  struct grpc_timer *next;
+  struct grpc_timer *prev;
   grpc_closure closure;
-} grpc_alarm;
+} grpc_timer;
 
-/* Initialize *alarm. When expired or canceled, alarm_cb will be called with
-   *alarm_cb_arg and status to indicate if it expired (SUCCESS) or was
-   canceled (CANCELLED). alarm_cb is guaranteed to be called exactly once,
+/* Initialize *timer. When expired or canceled, timer_cb will be called with
+   *timer_cb_arg and status to indicate if it expired (SUCCESS) or was
+   canceled (CANCELLED). timer_cb is guaranteed to be called exactly once,
    and application code should check the status to determine how it was
    invoked. The application callback is also responsible for maintaining
    information about when to free up any user-level state. */
-void grpc_alarm_init(grpc_exec_ctx *exec_ctx, grpc_alarm *alarm,
-                     gpr_timespec deadline, grpc_iomgr_cb_func alarm_cb,
-                     void *alarm_cb_arg, gpr_timespec now);
+void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
+                     gpr_timespec deadline, grpc_iomgr_cb_func timer_cb,
+                     void *timer_cb_arg, gpr_timespec now);
 
-/* Note that there is no alarm destroy function. This is because the
-   alarm is a one-time occurrence with a guarantee that the callback will
+/* Note that there is no timer destroy function. This is because the
+   timer is a one-time occurrence with a guarantee that the callback will
    be called exactly once, either at expiration or cancellation. Thus, all
-   the internal alarm event management state is destroyed just before
+   the internal timer event management state is destroyed just before
    that callback is invoked. If the user has additional state associated with
-   the alarm, the user is responsible for determining when it is safe to
+   the timer, the user is responsible for determining when it is safe to
    destroy that state. */
 
-/* Cancel an *alarm.
+/* Cancel an *timer.
    There are three cases:
-   1. We normally cancel the alarm
-   2. The alarm has already run
-   3. We can't cancel the alarm because it is "in flight".
+   1. We normally cancel the timer
+   2. The timer has already run
+   3. We can't cancel the timer because it is "in flight".
 
    In all of these cases, the cancellation is still considered successful.
-   They are essentially distinguished in that the alarm_cb will be run
+   They are essentially distinguished in that the timer_cb will be run
    exactly once from either the cancellation (with status CANCELLED)
    or from the activation (with status SUCCESS)
 
    Note carefully that the callback function MAY occur in the same callstack
-   as grpc_alarm_cancel. It's expected that most alarms will be cancelled (their
+   as grpc_timer_cancel. It's expected that most timers will be cancelled (their
    primary use is to implement deadlines), and so this code is optimized such
    that cancellation costs as little as possible. Making callbacks run inline
    matches this aim.
 
-   Requires:  cancel() must happen after add() on a given alarm */
-void grpc_alarm_cancel(grpc_exec_ctx *exec_ctx, grpc_alarm *alarm);
+   Requires:  cancel() must happen after add() on a given timer */
+void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer);
 
-#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_H */
diff --git a/src/core/iomgr/alarm_heap.c b/src/core/iomgr/timer_heap.c
similarity index 62%
rename from src/core/iomgr/alarm_heap.c
rename to src/core/iomgr/timer_heap.c
index 769142e..31d41d6 100644
--- a/src/core/iomgr/alarm_heap.c
+++ b/src/core/iomgr/timer_heap.c
@@ -31,7 +31,7 @@
  *
  */
 
-#include "src/core/iomgr/alarm_heap.h"
+#include "src/core/iomgr/timer_heap.h"
 
 #include <string.h>
 
@@ -43,7 +43,7 @@
    position. This functor is called each time immediately after modifying a
    value in the underlying container, with the offset of the modified element as
    its argument. */
-static void adjust_upwards(grpc_alarm **first, gpr_uint32 i, grpc_alarm *t) {
+static void adjust_upwards(grpc_timer **first, gpr_uint32 i, grpc_timer *t) {
   while (i > 0) {
     gpr_uint32 parent = (gpr_uint32)(((int)i - 1) / 2);
     if (gpr_time_cmp(first[parent]->deadline, t->deadline) >= 0) break;
@@ -58,8 +58,8 @@
 /* Adjusts a heap so as to move a hole at position i farther away from the root,
    until a suitable position is found for element t.  Then, copies t into that
    position. */
-static void adjust_downwards(grpc_alarm **first, gpr_uint32 i,
-                             gpr_uint32 length, grpc_alarm *t) {
+static void adjust_downwards(grpc_timer **first, gpr_uint32 i,
+                             gpr_uint32 length, grpc_timer *t) {
   for (;;) {
     gpr_uint32 left_child = 1u + 2u * i;
     gpr_uint32 right_child;
@@ -83,66 +83,66 @@
 #define SHRINK_MIN_ELEMS 8
 #define SHRINK_FULLNESS_FACTOR 2
 
-static void maybe_shrink(grpc_alarm_heap *heap) {
-  if (heap->alarm_count >= 8 &&
-      heap->alarm_count <= heap->alarm_capacity / SHRINK_FULLNESS_FACTOR / 2) {
-    heap->alarm_capacity = heap->alarm_count * SHRINK_FULLNESS_FACTOR;
-    heap->alarms =
-        gpr_realloc(heap->alarms, heap->alarm_capacity * sizeof(grpc_alarm *));
+static void maybe_shrink(grpc_timer_heap *heap) {
+  if (heap->timer_count >= 8 &&
+      heap->timer_count <= heap->timer_capacity / SHRINK_FULLNESS_FACTOR / 2) {
+    heap->timer_capacity = heap->timer_count * SHRINK_FULLNESS_FACTOR;
+    heap->timers =
+        gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer *));
   }
 }
 
-static void note_changed_priority(grpc_alarm_heap *heap, grpc_alarm *alarm) {
-  gpr_uint32 i = alarm->heap_index;
+static void note_changed_priority(grpc_timer_heap *heap, grpc_timer *timer) {
+  gpr_uint32 i = timer->heap_index;
   gpr_uint32 parent = (gpr_uint32)(((int)i - 1) / 2);
-  if (gpr_time_cmp(heap->alarms[parent]->deadline, alarm->deadline) < 0) {
-    adjust_upwards(heap->alarms, i, alarm);
+  if (gpr_time_cmp(heap->timers[parent]->deadline, timer->deadline) < 0) {
+    adjust_upwards(heap->timers, i, timer);
   } else {
-    adjust_downwards(heap->alarms, i, heap->alarm_count, alarm);
+    adjust_downwards(heap->timers, i, heap->timer_count, timer);
   }
 }
 
-void grpc_alarm_heap_init(grpc_alarm_heap *heap) {
+void grpc_timer_heap_init(grpc_timer_heap *heap) {
   memset(heap, 0, sizeof(*heap));
 }
 
-void grpc_alarm_heap_destroy(grpc_alarm_heap *heap) { gpr_free(heap->alarms); }
+void grpc_timer_heap_destroy(grpc_timer_heap *heap) { gpr_free(heap->timers); }
 
-int grpc_alarm_heap_add(grpc_alarm_heap *heap, grpc_alarm *alarm) {
-  if (heap->alarm_count == heap->alarm_capacity) {
-    heap->alarm_capacity =
-        GPR_MAX(heap->alarm_capacity + 1, heap->alarm_capacity * 3 / 2);
-    heap->alarms =
-        gpr_realloc(heap->alarms, heap->alarm_capacity * sizeof(grpc_alarm *));
+int grpc_timer_heap_add(grpc_timer_heap *heap, grpc_timer *timer) {
+  if (heap->timer_count == heap->timer_capacity) {
+    heap->timer_capacity =
+        GPR_MAX(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
+    heap->timers =
+        gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer *));
   }
-  alarm->heap_index = heap->alarm_count;
-  adjust_upwards(heap->alarms, heap->alarm_count, alarm);
-  heap->alarm_count++;
-  return alarm->heap_index == 0;
+  timer->heap_index = heap->timer_count;
+  adjust_upwards(heap->timers, heap->timer_count, timer);
+  heap->timer_count++;
+  return timer->heap_index == 0;
 }
 
-void grpc_alarm_heap_remove(grpc_alarm_heap *heap, grpc_alarm *alarm) {
-  gpr_uint32 i = alarm->heap_index;
-  if (i == heap->alarm_count - 1) {
-    heap->alarm_count--;
+void grpc_timer_heap_remove(grpc_timer_heap *heap, grpc_timer *timer) {
+  gpr_uint32 i = timer->heap_index;
+  if (i == heap->timer_count - 1) {
+    heap->timer_count--;
     maybe_shrink(heap);
     return;
   }
-  heap->alarms[i] = heap->alarms[heap->alarm_count - 1];
-  heap->alarms[i]->heap_index = i;
-  heap->alarm_count--;
+  heap->timers[i] = heap->timers[heap->timer_count - 1];
+  heap->timers[i]->heap_index = i;
+  heap->timer_count--;
   maybe_shrink(heap);
-  note_changed_priority(heap, heap->alarms[i]);
+  note_changed_priority(heap, heap->timers[i]);
 }
 
-int grpc_alarm_heap_is_empty(grpc_alarm_heap *heap) {
-  return heap->alarm_count == 0;
+int grpc_timer_heap_is_empty(grpc_timer_heap *heap) {
+  return heap->timer_count == 0;
 }
 
-grpc_alarm *grpc_alarm_heap_top(grpc_alarm_heap *heap) {
-  return heap->alarms[0];
+grpc_timer *grpc_timer_heap_top(grpc_timer_heap *heap) {
+  return heap->timers[0];
 }
 
-void grpc_alarm_heap_pop(grpc_alarm_heap *heap) {
-  grpc_alarm_heap_remove(heap, grpc_alarm_heap_top(heap));
+void grpc_timer_heap_pop(grpc_timer_heap *heap) {
+  grpc_timer_heap_remove(heap, grpc_timer_heap_top(heap));
 }
diff --git a/src/core/iomgr/alarm_heap.h b/src/core/iomgr/timer_heap.h
similarity index 68%
rename from src/core/iomgr/alarm_heap.h
rename to src/core/iomgr/timer_heap.h
index 91d6ee3..cd5258f 100644
--- a/src/core/iomgr/alarm_heap.h
+++ b/src/core/iomgr/timer_heap.h
@@ -31,27 +31,27 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H
-#define GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H
+#ifndef GRPC_INTERNAL_CORE_IOMGR_TIMER_HEAP_H
+#define GRPC_INTERNAL_CORE_IOMGR_TIMER_HEAP_H
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 
 typedef struct {
-  grpc_alarm **alarms;
-  gpr_uint32 alarm_count;
-  gpr_uint32 alarm_capacity;
-} grpc_alarm_heap;
+  grpc_timer **timers;
+  gpr_uint32 timer_count;
+  gpr_uint32 timer_capacity;
+} grpc_timer_heap;
 
-/* return 1 if the new alarm is the first alarm in the heap */
-int grpc_alarm_heap_add(grpc_alarm_heap *heap, grpc_alarm *alarm);
+/* return 1 if the new timer is the first timer in the heap */
+int grpc_timer_heap_add(grpc_timer_heap *heap, grpc_timer *timer);
 
-void grpc_alarm_heap_init(grpc_alarm_heap *heap);
-void grpc_alarm_heap_destroy(grpc_alarm_heap *heap);
+void grpc_timer_heap_init(grpc_timer_heap *heap);
+void grpc_timer_heap_destroy(grpc_timer_heap *heap);
 
-void grpc_alarm_heap_remove(grpc_alarm_heap *heap, grpc_alarm *alarm);
-grpc_alarm *grpc_alarm_heap_top(grpc_alarm_heap *heap);
-void grpc_alarm_heap_pop(grpc_alarm_heap *heap);
+void grpc_timer_heap_remove(grpc_timer_heap *heap, grpc_timer *timer);
+grpc_timer *grpc_timer_heap_top(grpc_timer_heap *heap);
+void grpc_timer_heap_pop(grpc_timer_heap *heap);
 
-int grpc_alarm_heap_is_empty(grpc_alarm_heap *heap);
+int grpc_timer_heap_is_empty(grpc_timer_heap *heap);
 
-#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_HEAP_H */
diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/timer_internal.h
similarity index 78%
rename from src/core/iomgr/alarm_internal.h
rename to src/core/iomgr/timer_internal.h
index 31d840e..f180eca 100644
--- a/src/core/iomgr/alarm_internal.h
+++ b/src/core/iomgr/timer_internal.h
@@ -31,33 +31,33 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H
-#define GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H
+#ifndef GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H
+#define GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H
 
 #include "src/core/iomgr/exec_ctx.h"
 #include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 
-/* iomgr internal api for dealing with alarms */
+/* iomgr internal api for dealing with timers */
 
-/* Check for alarms to be run, and run them.
-   Return non zero if alarm callbacks were executed.
+/* Check for timers to be run, and run them.
+   Return non zero if timer callbacks were executed.
    Drops drop_mu if it is non-null before executing callbacks.
-   If next is non-null, TRY to update *next with the next running alarm
-   IF that alarm occurs before *next current value.
+   If next is non-null, TRY to update *next with the next running timer
+   IF that timer occurs before *next current value.
    *next is never guaranteed to be updated on any given execution; however,
    with high probability at least one thread in the system will see an update
    at any time slice. */
 
-int grpc_alarm_check(grpc_exec_ctx* exec_ctx, gpr_timespec now,
+int grpc_timer_check(grpc_exec_ctx* exec_ctx, gpr_timespec now,
                      gpr_timespec* next);
-void grpc_alarm_list_init(gpr_timespec now);
-void grpc_alarm_list_shutdown(grpc_exec_ctx* exec_ctx);
+void grpc_timer_list_init(gpr_timespec now);
+void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx);
 
-gpr_timespec grpc_alarm_list_next_timeout(void);
+gpr_timespec grpc_timer_list_next_timeout(void);
 
 /* the following must be implemented by each iomgr implementation */
 
 void grpc_kick_poller(void);
 
-#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H */
diff --git a/src/core/surface/alarm.c b/src/core/surface/alarm.c
new file mode 100644
index 0000000..7c47dd5
--- /dev/null
+++ b/src/core/surface/alarm.c
@@ -0,0 +1,83 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/iomgr/timer.h"
+#include "src/core/surface/completion_queue.h"
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+
+struct grpc_alarm {
+  grpc_timer alarm;
+  grpc_cq_completion completion;
+  /** completion queue where events about this alarm will be posted */
+  grpc_completion_queue *cq;
+  /** user supplied tag */
+  void *tag;
+};
+
+static void do_nothing_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
+                                      grpc_cq_completion *c) {}
+
+static void alarm_cb(grpc_exec_ctx *exec_ctx, void *arg, int success) {
+  grpc_alarm *alarm = arg;
+  grpc_cq_end_op(exec_ctx, alarm->cq, alarm->tag, success,
+                 do_nothing_end_completion, NULL, &alarm->completion);
+}
+
+grpc_alarm *grpc_alarm_create(grpc_completion_queue *cq, gpr_timespec deadline,
+                              void *tag) {
+  grpc_alarm *alarm = gpr_malloc(sizeof(grpc_alarm));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  GRPC_CQ_INTERNAL_REF(cq, "alarm");
+  alarm->cq = cq;
+  alarm->tag = tag;
+
+  grpc_timer_init(&exec_ctx, &alarm->alarm, deadline, alarm_cb, alarm,
+                  gpr_now(GPR_CLOCK_MONOTONIC));
+  grpc_cq_begin_op(cq);
+  grpc_exec_ctx_finish(&exec_ctx);
+  return alarm;
+}
+
+void grpc_alarm_cancel(grpc_alarm *alarm) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_timer_cancel(&exec_ctx, &alarm->alarm);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void grpc_alarm_destroy(grpc_alarm *alarm) {
+  grpc_alarm_cancel(alarm);
+  GRPC_CQ_INTERNAL_UNREF(alarm->cq, "alarm");
+  gpr_free(alarm);
+}
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index b40e74d..1f8ffd8 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -42,7 +42,7 @@
 #include <grpc/support/useful.h>
 
 #include "src/core/channel/channel_stack.h"
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/profiling/timers.h"
 #include "src/core/support/string.h"
 #include "src/core/surface/api_trace.h"
@@ -237,7 +237,7 @@
   grpc_call_context_element context[GRPC_CONTEXT_COUNT];
 
   /* Deadline alarm - if have_alarm is non-zero */
-  grpc_alarm alarm;
+  grpc_timer alarm;
 
   /* Call refcount - to keep the call alive during asynchronous operations */
   gpr_refcount internal_refcount;
@@ -1027,7 +1027,7 @@
       GPR_ASSERT(call->read_state <= READ_STATE_STREAM_CLOSED);
       call->read_state = READ_STATE_STREAM_CLOSED;
       if (call->have_alarm) {
-        grpc_alarm_cancel(exec_ctx, &call->alarm);
+        grpc_timer_cancel(exec_ctx, &call->alarm);
       }
       /* propagate cancellation to any interested children */
       child_call = call->first_child;
@@ -1345,7 +1345,7 @@
   GPR_ASSERT(!c->destroy_called);
   c->destroy_called = 1;
   if (c->have_alarm) {
-    grpc_alarm_cancel(&exec_ctx, &c->alarm);
+    grpc_timer_cancel(&exec_ctx, &c->alarm);
   }
   cancel = c->read_state != READ_STATE_STREAM_CLOSED;
   unlock(&exec_ctx, c);
@@ -1470,7 +1470,7 @@
   GRPC_CALL_INTERNAL_REF(call, "alarm");
   call->have_alarm = 1;
   call->send_deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC);
-  grpc_alarm_init(exec_ctx, &call->alarm, call->send_deadline, call_alarm, call,
+  grpc_timer_init(exec_ctx, &call->alarm, call->send_deadline, call_alarm, call,
                   gpr_now(GPR_CLOCK_MONOTONIC));
 }
 
diff --git a/src/core/surface/channel_connectivity.c b/src/core/surface/channel_connectivity.c
index ca3c02c..1a2aef6 100644
--- a/src/core/surface/channel_connectivity.c
+++ b/src/core/surface/channel_connectivity.c
@@ -37,7 +37,7 @@
 #include <grpc/support/log.h>
 
 #include "src/core/channel/client_channel.h"
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/surface/api_trace.h"
 #include "src/core/surface/completion_queue.h"
 
@@ -78,7 +78,7 @@
   int success;
   int removed;
   grpc_closure on_complete;
-  grpc_alarm alarm;
+  grpc_timer alarm;
   grpc_connectivity_state state;
   grpc_completion_queue *cq;
   grpc_cq_completion completion_storage;
@@ -133,7 +133,7 @@
     gpr_mu_lock(&w->mu);
     w->success = 1;
     gpr_mu_unlock(&w->mu);
-    grpc_alarm_cancel(exec_ctx, &w->alarm);
+    grpc_timer_cancel(exec_ctx, &w->alarm);
   }
 
   gpr_mu_lock(&w->mu);
@@ -195,7 +195,7 @@
   w->tag = tag;
   w->channel = channel;
 
-  grpc_alarm_init(&exec_ctx, &w->alarm,
+  grpc_timer_init(&exec_ctx, &w->alarm,
                   gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC),
                   timeout_complete, w, gpr_now(GPR_CLOCK_MONOTONIC));
 
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index bcdb363..aa90b3f 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -36,6 +36,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "src/core/iomgr/timer.h"
 #include "src/core/iomgr/pollset.h"
 #include "src/core/support/string.h"
 #include "src/core/surface/api_trace.h"
@@ -46,6 +47,7 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/atm.h>
 #include <grpc/support/log.h>
+#include <grpc/support/time.h>
 
 typedef struct {
   grpc_pollset_worker *worker;
@@ -72,6 +74,15 @@
   grpc_closure pollset_destroy_done;
 };
 
+struct grpc_cq_alarm {
+  grpc_timer alarm;
+  grpc_cq_completion completion;
+  /** completion queue where events about this alarm will be posted */
+  grpc_completion_queue *cq;
+  /** user supplied tag */
+  void *tag;
+};
+
 static void on_pollset_destroy_done(grpc_exec_ctx *exec_ctx, void *cc,
                                     int success);
 
diff --git a/src/core/iomgr/alarm_heap.h b/src/cpp/common/alarm.cc
similarity index 66%
copy from src/core/iomgr/alarm_heap.h
copy to src/cpp/common/alarm.cc
index 91d6ee3..bce0b17 100644
--- a/src/core/iomgr/alarm_heap.h
+++ b/src/cpp/common/alarm.cc
@@ -1,5 +1,4 @@
 /*
- *
  * Copyright 2015, Google Inc.
  * All rights reserved.
  *
@@ -31,27 +30,20 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H
-#define GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H
+#include <grpc/grpc.h>
+#include <grpc++/alarm.h>
 
-#include "src/core/iomgr/alarm.h"
+namespace grpc {
 
-typedef struct {
-  grpc_alarm **alarms;
-  gpr_uint32 alarm_count;
-  gpr_uint32 alarm_capacity;
-} grpc_alarm_heap;
+Alarm::Alarm(CompletionQueue* cq, gpr_timespec deadline, void* tag)
+    : alarm_(grpc_alarm_create(cq->cq(), deadline, tag)) {}
 
-/* return 1 if the new alarm is the first alarm in the heap */
-int grpc_alarm_heap_add(grpc_alarm_heap *heap, grpc_alarm *alarm);
+Alarm::~Alarm() {
+  grpc_alarm_destroy(alarm_);
+}
 
-void grpc_alarm_heap_init(grpc_alarm_heap *heap);
-void grpc_alarm_heap_destroy(grpc_alarm_heap *heap);
+void Alarm::Cancel() {
+  grpc_alarm_cancel(alarm_);
+}
 
-void grpc_alarm_heap_remove(grpc_alarm_heap *heap, grpc_alarm *alarm);
-grpc_alarm *grpc_alarm_heap_top(grpc_alarm_heap *heap);
-void grpc_alarm_heap_pop(grpc_alarm_heap *heap);
-
-int grpc_alarm_heap_is_empty(grpc_alarm_heap *heap);
-
-#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H */
+}  // namespace grpc
diff --git a/test/core/iomgr/alarm_heap_test.c b/test/core/iomgr/timer_heap_test.c
similarity index 70%
rename from test/core/iomgr/alarm_heap_test.c
rename to test/core/iomgr/timer_heap_test.c
index 13bf7e4..941f61c 100644
--- a/test/core/iomgr/alarm_heap_test.c
+++ b/test/core/iomgr/timer_heap_test.c
@@ -31,7 +31,7 @@
  *
  */
 
-#include "src/core/iomgr/alarm_heap.h"
+#include "src/core/iomgr/timer_heap.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -48,8 +48,8 @@
   return ts;
 }
 
-static grpc_alarm *create_test_elements(size_t num_elements) {
-  grpc_alarm *elems = gpr_malloc(num_elements * sizeof(grpc_alarm));
+static grpc_timer *create_test_elements(size_t num_elements) {
+  grpc_timer *elems = gpr_malloc(num_elements * sizeof(grpc_timer));
   size_t i;
   for (i = 0; i < num_elements; i++) {
     elems[i].deadline = random_deadline();
@@ -63,17 +63,17 @@
   return i - j;
 }
 
-static size_t *all_top(grpc_alarm_heap *pq, size_t *n) {
+static size_t *all_top(grpc_timer_heap *pq, size_t *n) {
   size_t *vec = NULL;
   size_t *need_to_check_children;
   size_t num_need_to_check_children = 0;
 
   *n = 0;
-  if (pq->alarm_count == 0) return vec;
+  if (pq->timer_count == 0) return vec;
   need_to_check_children =
-      gpr_malloc(pq->alarm_count * sizeof(*need_to_check_children));
+      gpr_malloc(pq->timer_count * sizeof(*need_to_check_children));
   need_to_check_children[num_need_to_check_children++] = 0;
-  vec = gpr_malloc(pq->alarm_count * sizeof(*vec));
+  vec = gpr_malloc(pq->timer_count * sizeof(*vec));
   while (num_need_to_check_children > 0) {
     size_t ind = need_to_check_children[0];
     size_t leftchild, rightchild;
@@ -82,15 +82,15 @@
             num_need_to_check_children * sizeof(*need_to_check_children));
     vec[(*n)++] = ind;
     leftchild = 1u + 2u * ind;
-    if (leftchild < pq->alarm_count) {
-      if (gpr_time_cmp(pq->alarms[leftchild]->deadline,
-                       pq->alarms[ind]->deadline) >= 0) {
+    if (leftchild < pq->timer_count) {
+      if (gpr_time_cmp(pq->timers[leftchild]->deadline,
+                       pq->timers[ind]->deadline) >= 0) {
         need_to_check_children[num_need_to_check_children++] = leftchild;
       }
       rightchild = leftchild + 1;
-      if (rightchild < pq->alarm_count &&
-          gpr_time_cmp(pq->alarms[rightchild]->deadline,
-                       pq->alarms[ind]->deadline) >= 0) {
+      if (rightchild < pq->timer_count &&
+          gpr_time_cmp(pq->timers[rightchild]->deadline,
+                       pq->timers[ind]->deadline) >= 0) {
         need_to_check_children[num_need_to_check_children++] = rightchild;
       }
     }
@@ -101,7 +101,7 @@
   return vec;
 }
 
-static void check_pq_top(grpc_alarm *elements, grpc_alarm_heap *pq,
+static void check_pq_top(grpc_timer *elements, grpc_timer_heap *pq,
                          gpr_uint8 *inpq, size_t num_elements) {
   gpr_timespec max_deadline = gpr_inf_past(GPR_CLOCK_REALTIME);
   size_t *max_deadline_indices =
@@ -130,45 +130,45 @@
   gpr_free(top_elements);
 }
 
-static int contains(grpc_alarm_heap *pq, grpc_alarm *el) {
+static int contains(grpc_timer_heap *pq, grpc_timer *el) {
   size_t i;
-  for (i = 0; i < pq->alarm_count; i++) {
-    if (pq->alarms[i] == el) return 1;
+  for (i = 0; i < pq->timer_count; i++) {
+    if (pq->timers[i] == el) return 1;
   }
   return 0;
 }
 
-static void check_valid(grpc_alarm_heap *pq) {
+static void check_valid(grpc_timer_heap *pq) {
   size_t i;
-  for (i = 0; i < pq->alarm_count; ++i) {
+  for (i = 0; i < pq->timer_count; ++i) {
     size_t left_child = 1u + 2u * i;
     size_t right_child = left_child + 1u;
-    if (left_child < pq->alarm_count) {
-      GPR_ASSERT(gpr_time_cmp(pq->alarms[i]->deadline,
-                              pq->alarms[left_child]->deadline) >= 0);
+    if (left_child < pq->timer_count) {
+      GPR_ASSERT(gpr_time_cmp(pq->timers[i]->deadline,
+                              pq->timers[left_child]->deadline) >= 0);
     }
-    if (right_child < pq->alarm_count) {
-      GPR_ASSERT(gpr_time_cmp(pq->alarms[i]->deadline,
-                              pq->alarms[right_child]->deadline) >= 0);
+    if (right_child < pq->timer_count) {
+      GPR_ASSERT(gpr_time_cmp(pq->timers[i]->deadline,
+                              pq->timers[right_child]->deadline) >= 0);
     }
   }
 }
 
 static void test1(void) {
-  grpc_alarm_heap pq;
+  grpc_timer_heap pq;
   const size_t num_test_elements = 200;
   const size_t num_test_operations = 10000;
   size_t i;
-  grpc_alarm *test_elements = create_test_elements(num_test_elements);
+  grpc_timer *test_elements = create_test_elements(num_test_elements);
   gpr_uint8 *inpq = gpr_malloc(num_test_elements);
 
-  grpc_alarm_heap_init(&pq);
+  grpc_timer_heap_init(&pq);
   memset(inpq, 0, num_test_elements);
-  GPR_ASSERT(grpc_alarm_heap_is_empty(&pq));
+  GPR_ASSERT(grpc_timer_heap_is_empty(&pq));
   check_valid(&pq);
   for (i = 0; i < num_test_elements; ++i) {
     GPR_ASSERT(!contains(&pq, &test_elements[i]));
-    grpc_alarm_heap_add(&pq, &test_elements[i]);
+    grpc_timer_heap_add(&pq, &test_elements[i]);
     check_valid(&pq);
     GPR_ASSERT(contains(&pq, &test_elements[i]));
     inpq[i] = 1;
@@ -180,24 +180,24 @@
     GPR_ASSERT(contains(&pq, &test_elements[i]));
   }
 
-  GPR_ASSERT(pq.alarm_count == num_test_elements);
+  GPR_ASSERT(pq.timer_count == num_test_elements);
 
   check_pq_top(test_elements, &pq, inpq, num_test_elements);
 
   for (i = 0; i < num_test_operations; ++i) {
     size_t elem_num = (size_t)rand() % num_test_elements;
-    grpc_alarm *el = &test_elements[elem_num];
+    grpc_timer *el = &test_elements[elem_num];
     if (!inpq[elem_num]) { /* not in pq */
       GPR_ASSERT(!contains(&pq, el));
       el->deadline = random_deadline();
-      grpc_alarm_heap_add(&pq, el);
+      grpc_timer_heap_add(&pq, el);
       GPR_ASSERT(contains(&pq, el));
       inpq[elem_num] = 1;
       check_pq_top(test_elements, &pq, inpq, num_test_elements);
       check_valid(&pq);
     } else {
       GPR_ASSERT(contains(&pq, el));
-      grpc_alarm_heap_remove(&pq, el);
+      grpc_timer_heap_remove(&pq, el);
       GPR_ASSERT(!contains(&pq, el));
       inpq[elem_num] = 0;
       check_pq_top(test_elements, &pq, inpq, num_test_elements);
@@ -205,66 +205,66 @@
     }
   }
 
-  grpc_alarm_heap_destroy(&pq);
+  grpc_timer_heap_destroy(&pq);
   gpr_free(test_elements);
   gpr_free(inpq);
 }
 
 static void shrink_test(void) {
-  grpc_alarm_heap pq;
+  grpc_timer_heap pq;
   size_t i;
   size_t expected_size;
 
   /* A large random number to allow for multiple shrinkages, at least 512. */
   const size_t num_elements = (size_t)rand() % 2000 + 512;
 
-  grpc_alarm_heap_init(&pq);
+  grpc_timer_heap_init(&pq);
 
   /* Create a priority queue with many elements.  Make sure the Size() is
      correct. */
   for (i = 0; i < num_elements; ++i) {
-    GPR_ASSERT(i == pq.alarm_count);
-    grpc_alarm_heap_add(&pq, create_test_elements(1));
+    GPR_ASSERT(i == pq.timer_count);
+    grpc_timer_heap_add(&pq, create_test_elements(1));
   }
-  GPR_ASSERT(num_elements == pq.alarm_count);
+  GPR_ASSERT(num_elements == pq.timer_count);
 
   /* Remove elements until the Size is 1/4 the original size. */
-  while (pq.alarm_count > num_elements / 4) {
-    grpc_alarm *const te = pq.alarms[pq.alarm_count - 1];
-    grpc_alarm_heap_remove(&pq, te);
+  while (pq.timer_count > num_elements / 4) {
+    grpc_timer *const te = pq.timers[pq.timer_count - 1];
+    grpc_timer_heap_remove(&pq, te);
     gpr_free(te);
   }
-  GPR_ASSERT(num_elements / 4 == pq.alarm_count);
+  GPR_ASSERT(num_elements / 4 == pq.timer_count);
 
   /* Expect that Capacity is in the right range:
      Size * 2 <= Capacity <= Size * 4 */
-  GPR_ASSERT(pq.alarm_count * 2 <= pq.alarm_capacity);
-  GPR_ASSERT(pq.alarm_capacity <= pq.alarm_count * 4);
+  GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
+  GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
   check_valid(&pq);
 
   /* Remove the rest of the elements.  Check that the Capacity is not more than
      4 times the Size and not less than 2 times, but never goes below 16. */
-  expected_size = pq.alarm_count;
-  while (pq.alarm_count > 0) {
-    const size_t which = (size_t)rand() % pq.alarm_count;
-    grpc_alarm *te = pq.alarms[which];
-    grpc_alarm_heap_remove(&pq, te);
+  expected_size = pq.timer_count;
+  while (pq.timer_count > 0) {
+    const size_t which = (size_t)rand() % pq.timer_count;
+    grpc_timer *te = pq.timers[which];
+    grpc_timer_heap_remove(&pq, te);
     gpr_free(te);
     expected_size--;
-    GPR_ASSERT(expected_size == pq.alarm_count);
-    GPR_ASSERT(pq.alarm_count * 2 <= pq.alarm_capacity);
-    if (pq.alarm_count >= 8) {
-      GPR_ASSERT(pq.alarm_capacity <= pq.alarm_count * 4);
+    GPR_ASSERT(expected_size == pq.timer_count);
+    GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
+    if (pq.timer_count >= 8) {
+      GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
     } else {
-      GPR_ASSERT(16 <= pq.alarm_capacity);
+      GPR_ASSERT(16 <= pq.timer_capacity);
     }
     check_valid(&pq);
   }
 
-  GPR_ASSERT(0 == pq.alarm_count);
-  GPR_ASSERT(pq.alarm_capacity >= 16 && pq.alarm_capacity < 32);
+  GPR_ASSERT(0 == pq.timer_count);
+  GPR_ASSERT(pq.timer_capacity >= 16 && pq.timer_capacity < 32);
 
-  grpc_alarm_heap_destroy(&pq);
+  grpc_timer_heap_destroy(&pq);
 }
 
 int main(int argc, char **argv) {
diff --git a/test/core/iomgr/alarm_list_test.c b/test/core/iomgr/timer_list_test.c
similarity index 78%
rename from test/core/iomgr/alarm_list_test.c
rename to test/core/iomgr/timer_list_test.c
index 6656a8f..5a2d5b5 100644
--- a/test/core/iomgr/alarm_list_test.c
+++ b/test/core/iomgr/timer_list_test.c
@@ -31,11 +31,11 @@
  *
  */
 
-#include "src/core/iomgr/alarm.h"
+#include "src/core/iomgr/timer.h"
 
 #include <string.h>
 
-#include "src/core/iomgr/alarm_internal.h"
+#include "src/core/iomgr/timer_internal.h"
 #include <grpc/support/log.h>
 #include "test/core/util/test_config.h"
 
@@ -50,29 +50,29 @@
 static void add_test(void) {
   gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
   int i;
-  grpc_alarm alarms[20];
+  grpc_timer timers[20];
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  grpc_alarm_list_init(start);
+  grpc_timer_list_init(start);
   memset(cb_called, 0, sizeof(cb_called));
 
-  /* 10 ms alarms.  will expire in the current epoch */
+  /* 10 ms timers.  will expire in the current epoch */
   for (i = 0; i < 10; i++) {
-    grpc_alarm_init(&exec_ctx, &alarms[i],
+    grpc_timer_init(&exec_ctx, &timers[i],
                     gpr_time_add(start, gpr_time_from_millis(10, GPR_TIMESPAN)),
                     cb, (void *)(gpr_intptr)i, start);
   }
 
-  /* 1010 ms alarms.  will expire in the next epoch */
+  /* 1010 ms timers.  will expire in the next epoch */
   for (i = 10; i < 20; i++) {
-    grpc_alarm_init(
-        &exec_ctx, &alarms[i],
+    grpc_timer_init(
+        &exec_ctx, &timers[i],
         gpr_time_add(start, gpr_time_from_millis(1010, GPR_TIMESPAN)), cb,
         (void *)(gpr_intptr)i, start);
   }
 
-  /* collect alarms.  Only the first batch should be ready. */
-  GPR_ASSERT(10 == grpc_alarm_check(&exec_ctx,
+  /* collect timers.  Only the first batch should be ready. */
+  GPR_ASSERT(10 == grpc_timer_check(&exec_ctx,
                                     gpr_time_add(start, gpr_time_from_millis(
                                                             500, GPR_TIMESPAN)),
                                     NULL));
@@ -82,7 +82,7 @@
     GPR_ASSERT(cb_called[i][0] == 0);
   }
 
-  GPR_ASSERT(0 == grpc_alarm_check(&exec_ctx,
+  GPR_ASSERT(0 == grpc_timer_check(&exec_ctx,
                                    gpr_time_add(start, gpr_time_from_millis(
                                                            600, GPR_TIMESPAN)),
                                    NULL));
@@ -92,8 +92,8 @@
     GPR_ASSERT(cb_called[i][0] == 0);
   }
 
-  /* collect the rest of the alarms */
-  GPR_ASSERT(10 == grpc_alarm_check(
+  /* collect the rest of the timers */
+  GPR_ASSERT(10 == grpc_timer_check(
                        &exec_ctx, gpr_time_add(start, gpr_time_from_millis(
                                                           1500, GPR_TIMESPAN)),
                        NULL));
@@ -103,7 +103,7 @@
     GPR_ASSERT(cb_called[i][0] == 0);
   }
 
-  GPR_ASSERT(0 == grpc_alarm_check(&exec_ctx,
+  GPR_ASSERT(0 == grpc_timer_check(&exec_ctx,
                                    gpr_time_add(start, gpr_time_from_millis(
                                                            1600, GPR_TIMESPAN)),
                                    NULL));
@@ -112,7 +112,7 @@
     GPR_ASSERT(cb_called[i][0] == 0);
   }
 
-  grpc_alarm_list_shutdown(&exec_ctx);
+  grpc_timer_list_shutdown(&exec_ctx);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
@@ -122,34 +122,34 @@
   return t;
 }
 
-/* Cleaning up a list with pending alarms. */
+/* Cleaning up a list with pending timers. */
 void destruction_test(void) {
-  grpc_alarm alarms[5];
+  grpc_timer timers[5];
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  grpc_alarm_list_init(gpr_time_0(GPR_CLOCK_REALTIME));
+  grpc_timer_list_init(gpr_time_0(GPR_CLOCK_REALTIME));
   memset(cb_called, 0, sizeof(cb_called));
 
-  grpc_alarm_init(&exec_ctx, &alarms[0], tfm(100), cb, (void *)(gpr_intptr)0,
+  grpc_timer_init(&exec_ctx, &timers[0], tfm(100), cb, (void *)(gpr_intptr)0,
                   gpr_time_0(GPR_CLOCK_REALTIME));
-  grpc_alarm_init(&exec_ctx, &alarms[1], tfm(3), cb, (void *)(gpr_intptr)1,
+  grpc_timer_init(&exec_ctx, &timers[1], tfm(3), cb, (void *)(gpr_intptr)1,
                   gpr_time_0(GPR_CLOCK_REALTIME));
-  grpc_alarm_init(&exec_ctx, &alarms[2], tfm(100), cb, (void *)(gpr_intptr)2,
+  grpc_timer_init(&exec_ctx, &timers[2], tfm(100), cb, (void *)(gpr_intptr)2,
                   gpr_time_0(GPR_CLOCK_REALTIME));
-  grpc_alarm_init(&exec_ctx, &alarms[3], tfm(3), cb, (void *)(gpr_intptr)3,
+  grpc_timer_init(&exec_ctx, &timers[3], tfm(3), cb, (void *)(gpr_intptr)3,
                   gpr_time_0(GPR_CLOCK_REALTIME));
-  grpc_alarm_init(&exec_ctx, &alarms[4], tfm(1), cb, (void *)(gpr_intptr)4,
+  grpc_timer_init(&exec_ctx, &timers[4], tfm(1), cb, (void *)(gpr_intptr)4,
                   gpr_time_0(GPR_CLOCK_REALTIME));
-  GPR_ASSERT(1 == grpc_alarm_check(&exec_ctx, tfm(2), NULL));
+  GPR_ASSERT(1 == grpc_timer_check(&exec_ctx, tfm(2), NULL));
   grpc_exec_ctx_finish(&exec_ctx);
   GPR_ASSERT(1 == cb_called[4][1]);
-  grpc_alarm_cancel(&exec_ctx, &alarms[0]);
-  grpc_alarm_cancel(&exec_ctx, &alarms[3]);
+  grpc_timer_cancel(&exec_ctx, &timers[0]);
+  grpc_timer_cancel(&exec_ctx, &timers[3]);
   grpc_exec_ctx_finish(&exec_ctx);
   GPR_ASSERT(1 == cb_called[0][0]);
   GPR_ASSERT(1 == cb_called[3][0]);
 
-  grpc_alarm_list_shutdown(&exec_ctx);
+  grpc_timer_list_shutdown(&exec_ctx);
   grpc_exec_ctx_finish(&exec_ctx);
   GPR_ASSERT(1 == cb_called[1][0]);
   GPR_ASSERT(1 == cb_called[2][0]);
diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c
new file mode 100644
index 0000000..52fe4ea
--- /dev/null
+++ b/test/core/surface/alarm_test.c
@@ -0,0 +1,100 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void *create_test_tag(void) {
+  static gpr_intptr i = 0;
+  return (void *)(++i);
+}
+
+/* helper for tests to shutdown correctly and tersely */
+static void shutdown_and_destroy(grpc_completion_queue *cc) {
+  grpc_event ev;
+  grpc_completion_queue_shutdown(cc);
+  ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cc);
+}
+
+static void test_alarm(void) {
+  grpc_completion_queue *cc;
+
+  LOG_TEST("test_alarm");
+  cc = grpc_completion_queue_create(NULL);
+  {
+    /* regular expiry */
+    grpc_event ev;
+    void *tag = create_test_tag();
+    grpc_alarm *alarm =
+        grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), tag);
+
+    ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success);
+    grpc_alarm_destroy(alarm);
+  }
+  {
+    /* cancellation */
+    grpc_event ev;
+    void *tag = create_test_tag();
+    grpc_alarm *alarm =
+        grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), tag);
+
+    grpc_alarm_cancel(alarm);
+    ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success == 0);
+    grpc_alarm_destroy(alarm);
+  }
+  shutdown_and_destroy(cc);
+}
+
+int main(int argc, char **argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_alarm();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/cpp/common/alarm_test.cc b/test/cpp/common/alarm_test.cc
new file mode 100644
index 0000000..18083cd
--- /dev/null
+++ b/test/cpp/common/alarm_test.cc
@@ -0,0 +1,91 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc++/alarm.h>
+#include <grpc++/completion_queue.h>
+#include <gtest/gtest.h>
+
+#include "test/core/util/test_config.h"
+
+namespace grpc {
+namespace {
+
+class TestTag : public CompletionQueueTag {
+ public:
+  TestTag() : tag_(0) {}
+  TestTag(gpr_intptr tag) : tag_(tag) {}
+  bool FinalizeResult(void** tag, bool* status) { return true; }
+  gpr_intptr tag() { return tag_; }
+
+ private:
+  gpr_intptr tag_;
+};
+
+TEST(AlarmTest, RegularExpiry) {
+  CompletionQueue cq;
+  TestTag input_tag(1618033);
+  Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), &input_tag);
+
+  TestTag* output_tag;
+  bool ok;
+  const CompletionQueue::NextStatus status = cq.AsyncNext(
+      (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2));
+
+  EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
+  EXPECT_TRUE(ok);
+  EXPECT_EQ(output_tag->tag(), input_tag.tag());
+}
+
+TEST(AlarmTest, Cancellation) {
+  CompletionQueue cq;
+  TestTag input_tag(1618033);
+  Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), &input_tag);
+  alarm.Cancel();
+
+  TestTag* output_tag;
+  bool ok;
+  const CompletionQueue::NextStatus status = cq.AsyncNext(
+      (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1));
+
+  EXPECT_EQ(status, CompletionQueue::GOT_EVENT);
+  EXPECT_FALSE(ok);
+  EXPECT_EQ(output_tag->tag(), input_tag.tag());
+}
+
+}  // namespace
+}  // namespace grpc
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}