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 » IBM MQ API Support » MQCONNX MultiThread

Post new topic  Reply to topic
 MQCONNX MultiThread « View previous topic :: View next topic » 
Author Message
ManMan
PostPosted: Tue Dec 17, 2013 2:03 am    Post subject: MQCONNX MultiThread Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 17, 2013 5:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
ManMan
PostPosted: Tue Dec 17, 2013 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 17, 2013 9:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Did you link properly with thread safe libraries (_r)?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Tue Dec 17, 2013 2:44 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
ManMan
PostPosted: Tue Dec 17, 2013 10:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
ManMan
PostPosted: Tue Dec 17, 2013 10:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Wed Dec 18, 2013 2:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
ManMan
PostPosted: Wed Dec 18, 2013 2:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Wed Dec 18, 2013 4:24 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
ManMan
PostPosted: Thu Dec 26, 2013 4:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQCONNX MultiThread
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.