Author |
Message
|
ManMan |
Posted: Tue Dec 17, 2013 2:03 am Post subject: MQCONNX MultiThread |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
Hi Guys,
We request your help on the below please
We are able to connect with the Function do_conn in the amqscnxc.c program on a simple call but not on the thread creation.
Config : MQ 7.0.1.7 on AIX 1 7 000AF54BD400
Here is the output:
TT -x '10.10.182.37(1514)' -c SVR.CONN.CHL HBAX013D
Sample AMQSCNXC start
Connecting to queue manager HBAX013D
>>Launching thread 0
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. -1
tid 1 MQCONNX ended with reason code 2538
>>Launching thread 1
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. -1
tid 1 MQCONNX ended with reason code 2538
>>Launching do_conn() stalone 2
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. 9
tid 1 Connection established to queue manager HBAX013D
tid 1 c is 0 sleep for 5 seconds
tid 1 Connection established to queue manager HBAX013D
tid 1 c is 1 sleep for 5 seconds
tid 1 Sample AMQSCNXC thread end
Wait threads
Sample AMQSCNXC end |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 17, 2013 5:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So your reason code is 2538... consistently.
What have you checked? What is your environment like? Why do you think you are getting this reason code?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ManMan |
Posted: Tue Dec 17, 2013 7:34 am Post subject: |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
Thx for your reply.
I think its related to the thread creations, in other words, if i'm calling the same function "do_conn" from "amqscnxc_thread.c" without thread (pthread_create) its working fine.
The source code can be foudn here : http://www.capitalware.biz/dl/code/c/amqscnxc_thread.zip
Please have a look on the output , and comapre between part 1 and Part 2.
Part1 : create 2 threads based on the do_conn function.
Part2 : call directly the do_conn function.
Output:
Execution :
TT -x '10.10.182.37(1514)' -c SVR.CONN.CHL HBAX013D
=============>PART 1<============
Sample AMQSCNXC start
Connecting to queue manager HBAX013D
>>Launching thread 0
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. -1
tid 1 MQCONNX ended with reason code 2538
>>Launching thread 1
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. -1
tid 1 MQCONNX ended with reason code 2538
=============>PART 2<============
>>Launching do_conn() stalone 2
tid 1 Sample AMQSCNXC thread start
tid 1 using the server connection channel SVR.CONN.CHL
tid 1 on connection name 10.10.182.37(1514).
tid 1 on pQMName [HBAX013D].
tid 1 Hcon .. 9
tid 1 Connection established to queue manager HBAX013D
tid 1 c is 0 sleep for 5 seconds
tid 1 Connection established to queue manager HBAX013D
tid 1 c is 1 sleep for 5 seconds
tid 1 Sample AMQSCNXC thread end
Wait threads
Sample AMQSCNXC end
======================THX A LOT================== |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 17, 2013 9:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you link properly with thread safe libraries (_r)?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Dec 17, 2013 2:44 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Tim Zielke made those modifications to amqscnxc but I don't think he comes to mqseries.net.
Please post your makefile as I bet it is a problem with either your compile and/or link statements.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
ManMan |
Posted: Tue Dec 17, 2013 10:41 pm Post subject: |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
fjb_saper wrote: |
Did you link properly with thread safe libraries (_r)?  |
plz let me know how to do it ?
here is my libs ref
LIBS= -lpthread -L$(X_LIBPATH) -lpthr -lqueue -ltools -lutils -lcomora -lpiso -lget -lprivtlv -lprocessing -lhsmtdes -lauthotlv -L$(ORACLE_HOME)/lib $(ORACLE_LINK) -lmq -L/usr/mqm/lib64 -lmqic |
|
Back to top |
|
 |
ManMan |
Posted: Tue Dec 17, 2013 10:43 pm Post subject: |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
RogerLacroix wrote: |
Tim Zielke made those modifications to amqscnxc but I don't think he comes to mqseries.net.
Please post your makefile as I bet it is a problem with either your compile and/or link statements.
Regards,
Roger Lacroix
Capitalware Inc. |
Here is the Make file :
=============================
LIBS= -lpthread -L$(X_LIBPATH) -lpthr -lqueue -ltools -lutils -lcomora -lpiso -lget -lprivtlv -lprocessing -lhsmtdes -lauthotlv -L$(ORACLE_HOME)/lib $(ORACLE_LINK) -lmq -L/usr/mqm/lib64 -lmqic
all : MQ
OBJECTS_PUT = amqscnxc_thread.o
.pc.o:
$(PROC) $(PROCPLSFLAGS) $(PROCPPFLAGS) iname=$* ireclen=132
$(CC) -I../inc $*.c
.c.o :
$(CC) -I../inc $<
MQ : $(OBJECTS_PUT)
$(GCC) -I../inc $(OBJECTS_PUT) $(LIBS) $(LIBSTH) -o MQ
============================= |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Dec 18, 2013 2:02 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
As fjb suggested, why aren't you linking with "_r" libraries. i.e. mqic_r
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
ManMan |
Posted: Wed Dec 18, 2013 2:09 pm Post subject: |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
RogerLacroix wrote: |
As fjb suggested, why aren't you linking with "_r" libraries. i.e. mqic_r
Regards,
Roger Lacroix
Capitalware Inc. |
Ok , guys , i will do a test and revert back to you.
Thks a lot. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Dec 18, 2013 4:24 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
ManMan wrote: |
Config : MQ 7.0.1.7 on AIX 1 7 000AF54BD400 |
ManMan wrote: |
MQ : $(OBJECTS_PUT)
$(GCC) -I../inc $(OBJECTS_PUT) $(LIBS) $(LIBSTH) -o MQ |
GCC is not a supported compiler on AIX for MQ, so that could be problem. Also, the supported threading model under GCC may be different than IBM's CC (XLC) on AIX.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
ManMan |
Posted: Thu Dec 26, 2013 4:56 pm Post subject: |
|
|
Newbie
Joined: 17 Dec 2013 Posts: 6
|
ManMan wrote: |
RogerLacroix wrote: |
As fjb suggested, why aren't you linking with "_r" libraries. i.e. mqic_r
Regards,
Roger Lacroix
Capitalware Inc. |
Ok , guys , i will do a test and revert back to you.
Thks a lot. |
Thank you guys, its working have a good day. |
|
Back to top |
|
 |
|