# Use effect handlers like promises

**URL:** <https://discuss.ocaml.org/t/use-effect-handlers-like-promises/11683>\
**Category:** Learning\
**Tags:** multicore, multicore-ocaml\
**Created:** [March 16, 2023, 3:27pm UTC](https://discuss.ocaml.org/t/use-effect-handlers-like-promises/11683 "2023-03-16T15:27:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnuzhe](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@dnuzhe](https://discuss.ocaml.org/u/dnuzhe)\
**Post date:** [March 16, 2023, 3:27pm UTC](https://discuss.ocaml.org/t/use-effect-handlers-like-promises/11683/1 "2023-03-16T15:27:14Z")

</div>

hello!

i have a main thread and i want to run some computations in parallel using `fork` effect handler and then i want to get all the answers in the main thread and merge them. I guess it’s similar with idea of promises (futures). is there a good way how to do this? is it possible with using `xchg` effect?

---

<div class="post-metadata">

**Author:** ![patricoferris](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/patricoferris/32/3621_2.png) [@patricoferris](https://discuss.ocaml.org/u/patricoferris)\
**Post date:** [March 16, 2023, 3:45pm UTC](https://discuss.ocaml.org/t/use-effect-handlers-like-promises/11683/2 "2023-03-16T15:45:57Z")

</div>

A good place to start might be the promises examples in the ocaml-multicore/effects-examples repository [effects-examples/promises.ml at master · ocaml-multicore/effects-examples · GitHub](https://github.com/ocaml-multicore/effects-examples/blob/master/promises.ml) – this is nice and self-contained.
