in reply to Ressource dispatcher

My approach to such interprocess communication is to use a database (SQLite is very lightweight and suitable for this). This alleviates you from all the pesky problems of locking and gives you a convenient tool to query the status of every 3270 session and the job(s) running on it. Also, you can use the queue of jobs as a journal, so you even track which jobs (with their parameters) were run at what time, thus getting persistence.

Of course, if you plan to have the system pick up where it was on a restart, you will have to put some energy into creating "proper" job ids, so you know which parameters are needed to restart a job that was running but did not finish.