B4J Question Use of B4A Threading library

JackKirk

Well-Known Member
Licensed User
Longtime User
Scouring the forums I found this post by Erel:

https://www.b4x.com/android/forum/t...cts-over-the-network.34612/page-3#post-300680

The post is in a B4J thread so I am concluding that the B4A Threading library will work in B4J.

Q1: Is this correct?

Q2: Assuming "Yes", if I use the Threading library in a B4J application that runs on Windows 10 on a PC with multiple cores will the threads run on different cores?

Thanks...
 

Roycefer

Well-Known Member
Licensed User
Longtime User
Q1: Yes.
Q2: Naively, yes. There are a bunch of caveats and corner cases where they might not. For example, if other applications are using up all your cores, your B4J Threads may end up on the same core. But barring anything like that, the JVM will seek to run your Threads on as many cores as it can grab. You can verify this in the Performance tab of the Task Manager. Programmatically, you can access system CPU usage and JVM CPU usage with the jAWTRobot library in order to verify multi-core usage.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Programmatically, you can access system CPU usage and JVM CPU usage with the jAWTRobot library in order to verify multi-core usage.
Ah, you just answered my next question,
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I'm looking at a situation where I have to pass masses of approx 4Mbyte files via Http on a 100Mbit/s wireless link as quickly as possible up to AWS S3 buckets.

I wish to use all the cores available on the PC.

Any alternate suggestions to Threading welcome...
 
Upvote 0
Top