Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read / Allocate Cores
#7
(04-06-2023, 08:54 PM)dISP Wrote: That's an interesting idea because it would be pretty universal.  Different types of CPU's on the same OS would get the the same OS distribution. I had thought about using the chain command for the same idea but wasn't sure if I could get chains to run concurrently.

Still, it would be simpler if I could simply ask my single program to use multiple physical cores.  Even if there are no real qb64 commands, I have to believe their is a way for qb64 to ask MS windows how many cores I have and to use them.  But, I am not experienced with accessing MS windows from qb64.

https://qb64phoenix.com/qb64wiki/index.p..._Libraries

It's not possible in QB64, at least not in any reliable fashion, the best you can do is have multiple completely separate programs that run at the same time and communicate.

Like was mentioned, what you really want is threading support - you would create multiple threads in your program and then Windows/Linux/etc. will schedule them to run on whatever cores are available to the system. However while it's technically possible to create new threads via some `Declare Library` calls if you know the right magic, it won't work for very long because QB64 is not design for this and none of the functionality is thread-safe. Meaning, you cannot have two threads in your program running QB64 code at the same time, the various internal structures will eventually end-up corrupted.
Reply


Messages In This Thread
Read / Allocate Cores - by dISP - 04-06-2023, 12:17 PM
RE: Read / Allocate Cores - by mnrvovrfc - 04-06-2023, 01:31 PM
RE: Read / Allocate Cores - by dISP - 04-06-2023, 03:29 PM
RE: Read / Allocate Cores - by mnrvovrfc - 04-06-2023, 09:48 PM
RE: Read / Allocate Cores - by MasterGy - 04-06-2023, 07:37 PM
RE: Read / Allocate Cores - by dISP - 04-06-2023, 08:54 PM
RE: Read / Allocate Cores - by DSMan195276 - 04-10-2023, 03:54 AM
RE: Read / Allocate Cores - by mnrvovrfc - 04-10-2023, 07:51 AM
RE: Read / Allocate Cores - by mnrvovrfc - 04-21-2023, 06:10 PM
RE: Read / Allocate Cores - by dISP - 04-25-2023, 12:14 PM
RE: Read / Allocate Cores - by dISP - 04-25-2023, 12:23 PM



Users browsing this thread: 10 Guest(s)