× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Steve Richter wrote:
I just figured I would ask Hans the technical reasons for threads not being
supported in RPG.  Threads are not as mysterious as people might think they
and they help programmers solve problems.

As discussed, there are two possible implementations: First, take all the global data and pass it in to each thread, which is pretty ugly to implement. Second, we could put mutexes around all accesses to global data, which is also pretty nasty. The latter may in fact be counter-productive in that any performance gain that might be achieved in a threaded solution may be eaten up by the additional overhead of all the mutexes.


Sure, threads are commonly used in TCP server applications, in that one thread is spun off for each request (not for each transaction). If you implement a Java Servlet or a HTTP server using Python's xxxHTTPServer classes (to pick a couple of HTTP frameworks), that's what happens - one thread per request. In such schemes, state persistence can be achieved by saving data in global data structures indexed by a transaction id.

I could go on, but I'm afraid the discussion would simply devolve into yet another comparison of RPG versus other languages better suited to HTTP processing.

Cheers! Hans



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.