forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

multi-threading question

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
dlaroche-ca



Joined: 03 Jul 2013
Posts: 32
Location: Montréal, Québec, Canada

PostPosted: Thu Oct 23, 2014 10:17 pm    Post subject: multi-threading question Reply with quote

Hello list members!

I have a fairly big Python application running on VMS that creates threads. The threads work fine, except that they're confined to only one CPU/core. A colleague of mine modified one of his applications written in C to make it multi-threaded, and he had to link with qualifier
Quote:
/threads_enable=(MULTIPLE_KERNEL_THREADS,UPCALLS)


Would you know how easy (or difficult) it would be to build the interpreter using this qualifier?

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Fri Oct 24, 2014 6:41 am    Post subject: Reply with quote

Hello,

The link procedure :
https://repos.sysgroup.fr/OpenVMS/cpython27/files/5fe77cb382a7eea60bae2d89eead74360300e6ba/vms/link_py.com

contains a comment about upcalls disabled (problem on OpenVMS 8.3).

But if you want to try it you can use the comment
Code:
set image /flags=upcalls python_root:[vms.bin]python.exe


JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dlaroche-ca



Joined: 03 Jul 2013
Posts: 32
Location: Montréal, Québec, Canada

PostPosted: Mon Mar 09, 2015 7:36 pm    Post subject: Reply with quote

I just tried the set image command and it is an improvement. I'm running a test script on an rx2800 i2 with one 4-core CPU; VMS version is 8.4. The script starts 8 threads, each computing logarithms in a tight loop. Each thread prints a status line once in a while and I can see that all threads are running.

What's surprising though is that I don't see all 4 cores being busy. Command monitor process/topcpu shows that the process doesn't go over 200%, and this is confirmed with command show system/full/multithread that shows only two cores being active, the other two being in hibernate state.

Would you see a reason why the python executable is not using all the cores?

Thanks!
Back to top
View user's profile Send private message Send e-mail
dlaroche-ca



Joined: 03 Jul 2013
Posts: 32
Location: Montréal, Québec, Canada

PostPosted: Tue Mar 10, 2015 8:13 am    Post subject: Reply with quote

I found the answer to my last question after posting it. The VMS license installed on the server is for two units only.

But I have a more general question. Would you know if VMS system services are thread safe? For example I can imagine that issuing a QIO on the same mailbox from two different threads could be problematic, but would QIOs to different mailboxes be safe?

Thanks again.
Back to top
View user's profile Send private message Send e-mail
EisW



Joined: 07 Dec 2016
Posts: 4

PostPosted: Thu Dec 08, 2016 2:20 pm    Post subject: Reason for disabling /threads_enable=upcalls Reply with quote

Thank you for the helpful information in this topic, this saved me a lot of time!

I would like to have more info about possible problems with the /threads_enable=upcalls flag on python.exe:

Quote:
The link procedure :
https://repos.sysgroup.fr/OpenVMS/cpython27/files/5fe77cb382a7eea60bae2d89eead74360300e6ba/vms/link_py.com

contains a comment about upcalls disabled (problem on OpenVMS 8.3).


We require to use the link flag /threads_enable=upcalls. With help of this forum topic I found, that our python.exe does not have it. Setting the flag as suggestet with
Code:

set image /flags=upcalls python_root:[vms.bin]python.exe

works fine (until now tested only on OpenVMS8.4, but we have 8.3 too, I will test it)

We use successfully c++ code (no python) with this flag enabled in production environment on OpenVMS 8.3 and 8.4 and had never problems...

My Question: Are there any further infos regarding these problems with python?

Best regards
Tino
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Wed Dec 14, 2016 8:33 am    Post subject: Reply with quote

Hello Tino,

Unfortunately I don't remember what was the problem.

But if enable upcall work for you that's a good new.

I know others sites which have also enable upcall without any known problem.


JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group