# \[Java\] FoundationDB client thread related question

**URL:** <https://forums.foundationdb.org/t/java-foundationdb-client-thread-related-question/599>\
**Category:** Using FoundationDB\
**Created:** [July 29, 2018, 10:57am UTC](https://forums.foundationdb.org/t/java-foundationdb-client-thread-related-question/599 "2018-07-29T10:57:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://forums.foundationdb.org/u/gaurav)\
**Post date:** [July 29, 2018, 10:57am UTC](https://forums.foundationdb.org/t/java-foundationdb-client-thread-related-question/599/1 "2018-07-29T10:57:29Z")

</div>

Hi, developer guide ([Developer Guide — FoundationDB 7.1](https://apple.github.io/foundationdb/developer-guide.html#transaction-basics)) mention this advice:

> Blocking on anything else or performing CPU intensive tasks will block the FoundationDB client thread and therefore all database access from that client.

What is ` FoundationDB client thread` ? Is it the thread of the underlying C library?

I noticed that in Java (specifically) client API, the native `(C)` library future will schedule a future on the some Java executor (and further callbacks on those operations are called via this executor’s threads); so my question is - is it possible to block the ` FoundationDB client thread` in manner mentioned in dev guide? If so, can someone please post a small example to demonstrate it?

–  
thanks,  
gaurav

---

<div class="post-metadata">

**Author:** ![panghy](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/panghy/32/19_2.png) [@panghy](https://forums.foundationdb.org/u/panghy)\
**Post date:** [July 29, 2018, 5:04pm UTC](https://forums.foundationdb.org/t/java-foundationdb-client-thread-related-question/599/2 "2018-07-29T17:04:29Z")

</div>

I don’t think blocking the network thread is possible in Java, the executor is passed when the cluster is created for all callbacks.

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [August 8, 2018, 4:45pm UTC](https://forums.foundationdb.org/t/java-foundationdb-client-thread-related-question/599/3 "2018-08-08T16:45:45Z")

</div>

That’s right, it should be the case that all C callbacks are run through an executor in Java, which would normally move them onto another thread. If you are using an executor that can run code on the calling thread, though, then you would have access to the network thread and could then potentially block it.
