Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > does SYBASE work in multithreads?
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 27th July 20:28
jmclej
External User
 
Posts: 1
Default does SYBASE work in multithreads?



Hi, I am using version 12.0 of SYBASE on Sun Solaris 5.6
I have made an openserver using the libsrv provided in the sybase
package. And after having compiled with the "_r" libraries and "-mt"
compilation option, I have noticed that my program is still not
multithreaded.
Indeed when I create a RPC that takes an integer n as argument and
which only purpose is to loop n times, then when I call this RPC with
argument 10000000 and that I call immediately after, in a different
shell, the same RPC with argument 100, if my program would be
multithreaded, the second call should terminate far before the first
one, which is not the case. Furthermore, when I use the "top" command,
I can see the number of thread in the process, and it is not
increasing when I call several RPC at the same time.
After some investigation, I have seen that the variable SRV_S_PREEMPT
should be
set to CS_TRUE with srv_props(...) in the program. When I do this, It
compiles fine, but when I execute the program, when it comes to the
settnig of the variable SRV_S_PREEMPT, I get the following error "Open
Server Error: 16265/10. srv_props(): property: SRV_S_PREEMPT not
supported on this platform"
Am I doing the right thing to enable the multithreading? Are there
other things to do? Maybe the multithreading in SYBASE does not
concern the management of the RPC?
Thanks for your help,

JULIEN
  Reply With Quote


 


2 27th July 20:29
michael peppler
External User
 
Posts: 1
Default does SYBASE work in multithreads?



Open Server is multi-threaded, but it uses a non-preemptive threading
model in versions 12.0 and below. In this model your thread must
explicitly yield to let other threads run.

In 12.5 you can set the PREEMPT flag and have a truly multi-threaded
server.

See the OpenServer docs for 12.0 for more details.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler@peppler.org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html
  Reply With Quote


 


3 27th July 20:29
jmclej
External User
 
Posts: 1
Default how does SYBASE work in preemptive mode (multithreading)?


Thank you for confirming that it is this variable that I have to
set, but my problem is exactly when I set this variable to true that I
get this error saying that "I cannot use this option on my platform",
but what does it mean exactly? It doesn't say anything in case of
error in Sybase documentation. My platform is Sun Solaris 5.6 and is
working fine so far (it is running on a bank server, so very safe).
What does sybase mean by my improper platform then? I wouldn't want to
bother you with my repetitive questions, but it is good for me to
"use" the knowledge of a well-experienced person like you, and you
also seem keen on answering on that forum, so I take my chance again
;-) . Cheers.

JULIEN
  Reply With Quote
4 27th July 20:29
michael peppler
External User
 
Posts: 1
Default how does SYBASE work in preemptive mode (multithreading)?


That the PREEMPT flag doesn't work in OpenServer 12.0. You need OpenServer
12.5 for this to work.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler@peppler.org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html
  Reply With Quote
Reply


Thread Tools
Display Modes




666