Page 1 of 1 1
Topic Options
#166645 - 2006-08-31 06:41 AM Multithreading and pointers
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
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

Top
#166646 - 2006-08-31 06:56 AM Re: Multithreading and pointers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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

Top
#166647 - 2006-08-31 07:46 AM Re: Multithreading and pointers
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
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.

Top
#166648 - 2006-08-31 07:48 AM Re: Multithreading and pointers
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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?

Top
#166649 - 2006-08-31 08:05 AM Re: Multithreading and pointers
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
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

Top
#166650 - 2006-08-31 09:51 AM Re: Multithreading and pointers
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
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.

Top
#166651 - 2006-09-01 01:57 AM Re: Multithreading and pointers
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
Thanks for the tip reqarding asynchronous queries.
Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 84 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.103 seconds in which 0.066 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org