求教Tuxedo高手高高手!C#调用Tuxedo多线程问题。
使用C#调用 Tuxedo 的单线程不存在问题了。
但是C#调用Tuxedo 的多线程时,并发提交时出现问题。网上曾经有相应资料描述: Tuxedo 多线程的调用与单线程的调用方法不同。参考资料:
Tuxedo 实现的原理(TUXEDO在自动语音应答系统中的使用)
http://www.ctiforum.com/forum/2002/11/forum02_1124.htm
C++  里调用 Tuxedo 多线程 实例:
http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=4&threadID=29516&messageID=177720
其他资料。
http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=4&threadID=30943&messageID=183977
我的单线程做法是用 DllImport 方法包起来: #if NATIVE
[DllImport("libtux", SetLastError=true)]
#else
[DllImport("libwsc", SetLastError=true)]
#endif
static extern unsafe int tpinit(tpinfo_t i);
#if NATIVE
[DllImport("libtux", SetLastError=true)]
#else
[DllImport("libwsc", SetLastError=true)]
#endif
static extern unsafe int tpcall(
[MarshalAs(UnmanagedType.LPStr)] string svc,
IntPtr idata,
int ilen,
out IntPtr odata,
out int olen, 
int flags);之类的做法:现在的问题是:
原 bea 定义  tpinfo_t 
struct tpinfo_t {
char usrname[MAXTIDENT+2]; /* client user name */
char cltname[MAXTIDENT+2]; /* application client name */
char passwd[MAXTIDENT+2]; /* application password */
char grpname[MAXTIDENT+2]; /* client group name */
long flags; /* initialization flags */
long datalen; /* length of app specific data */
long data; /* placeholder for app data */
};typedef struct tpinfo_t TPINIT;{
   用法:
   TPINIT * tpinitbuf;    
   tpinitbuf=tpalloc("TPINIT", NULL, TPINITNEED(0));      // tpinitbuf 是指针哦。}
   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
struct tpinfo_t
   { 
  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]  public string usrname;
  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]  public string cltname;
  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]  public string passwd;
  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]  public string grpname;
  public int flags;
  public int datalen;
  public int data;
   } 
{
tpinfo_t tpinitbuf = new tpinfo_t();
IntPtr ptpinitbuf ; ptpinitbuf = TPalloc("TPINIT", null, System.Runtime.InteropServices.Marshal.SizeOf(tpinitbuf));                            /////  tpalloc 是分配内存单元的,如何 将  ptpinitbuf(指针) 附给 tpinitbuf 呢?郁闷中。 
}好似都是 非托管内存 的问题,但对这部分不熟。唉。以前调Tuxedo 都网上有一段调用的代码,借用过来的。 请各位专家指点迷津。