Python Forum
sharing variables between two processes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sharing variables between two processes
#1
Hi, I have a bit of code that I need to run in parallel to another code. In this code I need to update two variables so both processes can read and update, with the use of locks from threading module. I cannot figure out how to share variables between these two processes. Can someone tell me how?
Reply
#2
Say more about what you're trying to do. Why exactly is there a need to share mutable state? Id you can avoid it, you can avoid having to lock.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to secure API key when sharing quarinteen 2 1,006 Jan-19-2024, 04:46 PM
Last Post: deanhystad
  processes shall be parallel flash77 4 1,828 Sep-20-2022, 11:46 AM
Last Post: DeaD_EyE
  Sharing imported modules with Sub Processes? Stubblemonster 2 2,159 May-02-2022, 06:42 AM
Last Post: Stubblemonster
  How to install modules for 2.7 (or sharing from 3.8)) Persisto 2 3,495 Dec-31-2021, 02:33 PM
Last Post: Persisto
  Killing processes via python Lavina 2 3,818 Aug-04-2021, 06:20 AM
Last Post: warnerarc
  multiprocessing and sharing object cyrduf 0 2,626 Feb-02-2021, 08:16 PM
Last Post: cyrduf
  Sharing my code emirasal 2 2,651 Oct-04-2020, 02:21 PM
Last Post: emirasal
  2 or more processes on the write end of the same pipe Skaperen 4 5,359 Sep-27-2020, 06:41 PM
Last Post: Skaperen
  Sharing X Axis in Sub plots JoeDainton123 1 2,793 Aug-22-2020, 04:11 AM
Last Post: deanhystad
  Errors using --processes parameter sonhospa 3 3,088 Jul-01-2020, 02:24 PM
Last Post: sonhospa

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020