support of the full java.util.concurrent API?

17 views
Skip to first unread message

Thomas

unread,
Mar 28, 2019, 5:11:27 PM3/28/19
to CodenameOne Discussions
Hi
  I am trying to implement some complex multi-threading process in my app (with complex objects that can be partially and parallely fetched from a server and that are populated (with some computation from the fetched data and local data) as soon as each part is received) but the lack of the java.util.concurrent.lock API is making it really difficult to do it right. 
So I am wondering. Is there any plans to port this API to CN1? 
Support of an efficient real multi-threading (with allowed shared memory between threads and a full control of the design) is one of the advantages of java against javascript or even dart (i.e flutter) frameworks (especially since devices are now all multi-cores). So it's a pity that it is actually quite basic in CN1 and do not include the full java.util.concurrent API.

Shai Almog

unread,
Mar 28, 2019, 11:27:56 PM3/28/19
to CodenameOne Discussions
Hi,
it's a bit hard to implement that full API. A more pragmatic approach is narrowing this down to an RFE about specific classes/methods. We might include some features of that ideally in the Codename One packages to keep things simple as changing the VM takes much longer than implementing a small subset in our own packages.

Notice that this matters more for server processes. On devices you shouldn't use too many threads anyway as there is a limit to the number of cores a device would have. FYI we have 

FYI check out EasyThread which makes working with a separate thread relatively easy.
Reply all
Reply to author
Forward
0 new messages