ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Security Exit Threads

Post new topic  Reply to topic
 Security Exit Threads « View previous topic :: View next topic » 
Author Message
sms@pccl.demon.co.uk
PostPosted: Thu Jan 05, 2006 4:07 am    Post subject: Security Exit Threads Reply with quote

Newbie

Joined: 05 Jan 2006
Posts: 3
Location: UK

I'm writing my first MQ Channel Security Exit. It is to run on Solaris and possibly Linux.

The "Interconnections" manual says that Exit code must make thread-safe calls, which I can do. However, it does not say whether it is possible for a Security Exit to be called concurrently with itself. If it can be called concurrently then it will have to be thread-safe too (eg by using thread-specific data).

Does anyone know whether the code should be thread safe or can I assume that the Exit Code will be called serially?

TIA.
Back to top
View user's profile Send private message Visit poster's website
EddieA
PostPosted: Thu Jan 05, 2006 9:17 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

I don't have any experience with this, but if the manual says:
Quote:
Exit code must make thread-safe calls

then my assumption would be the opposite of yours. I would assume that the code must be thread save. Or IBM woudln't have made that statement.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
sms@pccl.demon.co.uk
PostPosted: Fri Jan 06, 2006 1:15 am    Post subject: Reply with quote

Newbie

Joined: 05 Jan 2006
Posts: 3
Location: UK

Thanks Eddie.

In order to prove the situation I have performed the following experiment:

1. Write a security exit which writes to a log file, sleeps for 5 seconds, writes to the log file again and then returns.

2. Arrange for two channels to be opened at the same time.

The log files show sequences like:

entry - entry - exit -exit

This shows that the function is running concurrently so it has to be thread-safe.
Back to top
View user's profile Send private message Visit poster's website
sms@pccl.demon.co.uk
PostPosted: Fri Jan 06, 2006 1:56 am    Post subject: Reply with quote

Newbie

Joined: 05 Jan 2006
Posts: 3
Location: UK

I forgot to say why I was worried about this. The Redbook on Channel Security Exits (SG24-5306-00) contains an example Exit. The code uses several global variables so it does not appear to be thread-safe.

So, the documentation suggests that there is no need to write thread-safe code. However, the experiment I performed early shows that thread-safe code is required.
Back to top
View user's profile Send private message Visit poster's website
mvic
PostPosted: Wed Jan 11, 2006 3:34 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

sms@pccl.demon.co.uk wrote:
The Redbook on Channel Security Exits (SG24-5306-00) contains an example Exit. The code uses several global variables so it does not appear to be thread-safe.


I checked the redbook...

http://publib-b.boulder.ibm.com/abstracts/sg245306.html?Open

...and the date is 1998. In those days it may well (someone correct me?) have been most common to run channels in single-threaded processes on *ix.

For a couple of releases now, MQ has had a much more sophisticated multi-threaded channel capability involving master (runmqlsr) and slave (amqrmppa) channel processes running about 60 threads per process. But AFAIK it is still possible to run single threaded channels - well I can see /opt/mqm/bin/runmqchl so I assume this is the case.
Back to top
View user's profile Send private message
KeeferG
PostPosted: Thu Jan 12, 2006 3:17 am    Post subject: Reply with quote

Master

Joined: 15 Oct 2004
Posts: 215
Location: Basingstoke, UK

From the docs
Quote:

MCATYPE
Specifies whether the message-channel-agent program should run as a thread or a process.
PROCESS
The message channel agent runs as a separate process
THREAD
The message channel agent runs as a separate thread

In situations where a threaded listener is required to service a large number of incoming requests, resources can become strained. In this case, you should use multiple listener processes and target incoming requests at specific listeners though the port number specified on the listener.


This parameter is valid only for channels with a channel type (CHLTYPE) of SDR, SVR, RQSTR, CLUSSDR, or CLUSRCVR. It is supported only on AIX, Compaq OpenVMS, HP-UX, Linux, OS/2 Warp, OS/400, Solaris, and Windows.

On z/OS it is supported only for channels with a channel type of CLUSRCVR. When specified in a CLUSRCVR definition, MCATYPE is used by a remote machine to determine the corresponding CLUSSDR definition.



_________________
Keith Guttridge
-----------------
Using MQ since 1995
Back to top
View user's profile Send private message Visit poster's website
mvic
PostPosted: Thu Jan 12, 2006 3:28 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Quote:
In situations where a threaded listener is required to service a large number of incoming requests, resources can become strained. In this case, you should use multiple listener processes and target incoming requests at specific listeners though the port number specified on the listener.


Hmm, I would like to hear others' opinions here, but I think that is a bit out of date. MQ 5.3 and 6 have a much more scalable design, with master and slave channel responders, so that no single process ends up doing all the work for a given IP port.

Therefore no need, for the sake of scalability, to have multiple listeners on multiple IP ports for a single queue manager.
Back to top
View user's profile Send private message
KeeferG
PostPosted: Thu Jan 12, 2006 4:28 am    Post subject: Reply with quote

Master

Joined: 15 Oct 2004
Posts: 215
Location: Basingstoke, UK

It does sound a bit out of date. As you point out, a lot of work has gone into the multi-threaded lisening processes.

The joys of cut and paste from the manuals.

In most cases mutlithreaded is fine however there are scenarios where single threaded is requried as in the case at my company
_________________
Keith Guttridge
-----------------
Using MQ since 1995
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Security Exit Threads
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.