It_took_my_meds
(Hey THIS is FUN)
2006-08-31 06:41 AM
Multithreading and pointers

Hi Ruud et. al.,
I would like to see the ability to spawn threads as well as create pointers. I guess the threading syntax could be similar to that in Perl. The pointer syntax could be something like

Code:
$var = "Test"
$pointer = /$var
$var = \$pointer ; equals "Test"


Cheers,
Richard


LonkeroAdministrator
(KiX Master Guru)
2006-08-31 06:56 AM
Re: Multithreading and pointers

richard, pointers are in the wishlist already as it has been asked many many times.
good to see that ppl still keep voting for it.
not sure about your syntax though

threading syntax can be left open as pointer syntax may interfere with it.
nonetheless, awesome post.

thanks.
just hope Ruud reads this on good day


It_took_my_meds
(Hey THIS is FUN)
2006-08-31 07:46 AM
Re: Multithreading and pointers

Thanks Jooel.
I have certainly seen posts by people wanting to pass to by reference but haven't seen anyone mention pointers directly. I guess what I was trying add was that I would prefer the syntax of creating a pointer rather than using ByRef and ByVal in functions.

As for spawning threads, this would be very useful especially for KiXforms apps. I would love to be able to keep the GUI from freezing when waiting for long running external calls.


LonkeroAdministrator
(KiX Master Guru)
2006-08-31 07:48 AM
Re: Multithreading and pointers

I was thinking... think I made a suggestion some time back about spawning...
never got to the list though.

multithreading is not limited to spawning but offers much more.
so, you actually looking for ability to spawn processes?


It_took_my_meds
(Hey THIS is FUN)
2006-08-31 08:05 AM
Re: Multithreading and pointers

No, spawning processes is easy; threads are another matter.

For example there is currently no way to start a child form that is populated by a long running query to a DB and still use the parent form while the DB query is running.

If you know of a way then please let me know!

Richard


Richard H.Administrator
(KiX Supporter)
2006-08-31 09:51 AM
Re: Multithreading and pointers

Forking a process or starting a new thread is an interesting idea. I have a server monitor script that RUNs a new KiXtart instance for every server polled - it would have been much easier to implement with Fork().

We'd probably need some some of inter-process communication for data exchange and latches for process control, but that's not such a bad thing. The really hard bit would be ensuring that all the libraries that KiXtart uses are thread safe which might mean dropping some of the older versions of Windows from support.

For a full implementation it would be nice to have signalling, trapping and error handling ("events"), but can probably get around most of that with IPC.

Quote:

For example there is currently no way to start a child form that is populated by a long running query to a DB and still use the parent form while the DB query is running.

If you know of a way then please let me know!





Use an asynchronous ODBC query. You initiate the query then poll the object to see when it has finished.


It_took_my_meds
(Hey THIS is FUN)
2006-09-01 01:57 AM
Re: Multithreading and pointers

Thanks for the tip reqarding asynchronous queries.