Re: [Oorexx-devel] Question ad RexxSetHalt()

2011-08-06 Thread Jean-Louis Faucher
I see two reasons to return RXARI_NOT_FOUND from RexxSetHalt :
either the interpreter is not started (not your case)
or the threadid parameter is not registered with a RexxActivity
(the procid parameter is not used)

0 is not a good value for threadid (I saw this value in one of your next
mails).

Jean-Louis

2011/8/3 Rony G. Flatscher rony.flatsc...@wu-wien.ac.at

 **
 When issuing a RexxSetHalt() to halt all Rexx threads with

 size_t res=RexxSetHalt(getpid(), (pthread_t) 0);



  the result is 1, which according to rexxpg.pdf means:RXARI_NOT_FOUND 1
 The target Rexx procedure was not found..

 The documentation reads:

 10.10.1.1. RexxSetHalt

 RexxSetHalt raises a HALT condition in a running Rexx program.


 retc = RexxSetHalt(ProcessId, ThreadId);


 10.10.1.1.1. Parameters

 ProcessId (process_id_t) - input
is the process ID of the target Rexx procedure. ProcessId is the
 application process that called the
RexxStart function.

 ThreadId (thread_id_t) - input
is the thread ID of the target Rexx procedure. ThreadId is the
 application thread that called the
RexxStart function. If ThreadId=0, all the threads of the process are
 canceled.

 10.10.1.1.2. Return Codes

 RXARI_OK 0 The function completed successfully.
 RXARI_NOT_FOUND 1 The target Rexx procedure was not found.
 RXARI_PROCESSING_ERROR 2 A failure in Rexx processing occurred.

 10.10.1.1.3. Remarks

 This call is not processed if the target Rexx program is running with the
 RXHLT exit enabled.

 ---

 RexxSetHalt() is issued on another thread than the one that issued
 RexxStart(), but in the same process, of course.

 Is the ProcessId-related documentaiton wrong? Should it read thread
 instead of application process or is the API wrong or is there another
 reason one would get 1 as a result?

 ---rony



 --
 BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
 The must-attend event for mobile developers. Connect with experts.
 Get tools for creating Super Apps. See the latest technologies.
 Sessions, hands-on labs, demos  much more. Register early  save!
 http://p.sf.net/sfu/rim-blackberry-1
 ___
 Oorexx-devel mailing list
 Oorexx-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/oorexx-devel


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Howto end a Rexx interpreter instance in the following scenario ?

2011-08-06 Thread Jean-Louis Faucher
Could it be what you need ?

context-Halt
Raise a HALT condition on all threads associated with the interpreter
instance

Jean-Louis

2011/8/3 Rony G. Flatscher rony.flatsc...@wu-wien.ac.at

 **
 The aforementioned Rexx server use case can be changed to be ended: if one
 ends the main thread (by not issuing a SysSleep() or doing a parse pull) and
 the message loop thread is running, then once the message loop thread ends
 (e.g. because of a Rexx condition, but also for other reasons) the program
 ends altogether.

 ---rony




 On 03.08.2011 20:53, Rony G. Flatscher wrote:

 The following scenario (a Rexx object running in the role of a server):

- a Rexx program gets started, serving as a server, dispatching
messages from clients
 - creates a message loop on a separate thread, dispatching messages
   from client
- either calls SysSleep(someTime) or does parse pull x to keep
the Rexx program alive

 Now, whenever a syntax error occurs while a Rexx message gets dispatched on
 the message loop thread (maybe even on another thread), it is not noticed by
 the main thread, it seems.

 In the message loop thread the Rexx condition causes it to be stopped and
 the message-loop thread goes away.

 However the main Rexx thread (either in SysSleep() or parse pull x)
 keeps on running, it seems.

 As reported in a previous message, RexxSetHalt(processId,0) returns 1
 and does not work for ending all Rexx threads from the message loop thread,
 which knows that the state of the Rexx server application has become
 unstable, because of the syntax error that occurred on one of its
 dispatches.

 ---

 How is one able to end the threads of a Rexx interpreter instance?

 ---rony




 --
 BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
 The must-attend event for mobile developers. Connect with experts.
 Get tools for creating Super Apps. See the latest technologies.
 Sessions, hands-on labs, demos  much more. Register early  save!
 http://p.sf.net/sfu/rim-blackberry-1
 ___
 Oorexx-devel mailing list
 Oorexx-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/oorexx-devel


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Question ad RexxSetHalt()

2011-08-06 Thread Rony G. Flatscher

On 06.08.2011 12:22, Jean-Louis Faucher wrote:
 I see two reasons to return RXARI_NOT_FOUND from RexxSetHalt :
 either the interpreter is not started (not your case)
 or the threadid parameter is not registered with a RexxActivity
 (the procid parameter is not used)

 0 is not a good value for threadid (I saw this value in one of your
 next mails).
Did use hat particular value, because of the documentation of
10.10.1.1.1. Parameters in rexxpg.pdf:


 ProcessId (process_id_t) - input
is the process ID of the target Rexx procedure. ProcessId
 is the application process that called the
RexxStart function.

 ThreadId (thread_id_t) - input
is the thread ID of the target Rexx procedure. ThreadId is
 the application thread that called the
RexxStart function. If ThreadId=0, all the threads of the
 process are canceled.

---rony

--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Howto end a Rexx interpreter instance in the following scenario ?

2011-08-06 Thread Rony G. Flatscher

On 06.08.2011 12:23, Jean-Louis Faucher wrote:
 Could it be what you need ?

 context-Halt
 Raise a HALT condition on all threads associated with the interpreter
 instance
*YES*, thank you very much, Jean-Louis !
(Haven't seen the forest for the trees anymore...)

---rony



--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel