FoundationDB

[Java] FoundationDB client thread related question


(gaurav) #1

Hi, developer guide (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


(Clement Pang) #2

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


(A.J. Beamon) #3

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.