spid is the server process id and the kpid is kernal process id, each spid having one kpid which denote the memory location for the process. also in between spid map to host process id and it map to kpid.
you can see the kpid in sybase using sysprocesses table.
Thanks for the reply
Please correct me if my understanding is incorrect---
Can we say that on given server the kpid wont get repeated any time..coz I know that spid can get repeated once the process gets completed or is killed for some reason
Sorry for the same.
When ever any transaction you will start that time one exact id will get create, you can see this in sybase using syslogshold or systransactions table
select * from syslogshold.
if you see that exact id it will be unique for each DB and that unique id having one spid, that ( can be see in same table(, Now each spid is map with one kpid at OS level ( can be see that kpid column in sysprocesses table )also this you can see using below command.
select spid,kpid,hostprocesses from sysprocesses where cmd not like "AWAI%"
This kpid is unique till the OS Reboot. After OS reboot that can be used by OS it self. This kpid i used for the memory location (i.e that processes is using which memory location in shared memory). This will get lock until that process execution will not get complete. For total shared memory location you can see using cat $SYBASE/$SYBASE_ASE/<server_name>.krg file.
In this you will get memory location for the total max memory i.e shared memory. If you did rm for this file when your ASE is up then you can not shut down the ASE by normal method you need to take the OS reboot for the same.
Also kpid can be see in ipcs -ma command this will be for the shared memory for each ASE and the OS level processes.