×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi gang,

OK, general question - no real need to do this but I'm just interested in
knowing the answer:

We all know RPG is not a mutlti-threaded language, but would it be
reasonable in RPG to use pthread_create() to create new threads and use
pthread_mutex_lock() and pthread_mutex_unlock() to protect critical code? I
know we can use spawn and BCI jobs, but can we create a pthread and call a
RPG (sub)procedure in it? I'm guessing spawn doesn't really create a POSIX
thread and uses a BCI job instead. Or is it all the same?

A follow-on question would be if we can't create threads in RPG using
pthread_create(), can we still use mutexes in RPG code that is called from a
multi-threaded language? I know further support will be provided in the next
OS release so we don't have to serialize the threads when calling RPG from
java but I was wondering if we could roll-our-own 'very limited'
multi-threaded support using mutexes.

Your thoughts on this would be most welcome.

Cheers

Larry Ducie

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.