Date: Mon, 27 Aug 2001 09:56:24 -0700 From: Arun Sharma <arun@sharmas.dhs.org> To: Fuyuhiko Maruyama <fuyuhik8@is.titech.ac.jp> Cc: java@FreeBSD.ORG Subject: Re: JVM and native threads Message-ID: <20010827095624.B14875@sharmas.dhs.org> In-Reply-To: <55k7zqnd1x.wl@tripper.private>; from fuyuhik8@is.titech.ac.jp on Mon, Aug 27, 2001 at 05:04:58PM %2B0900 References: <20010824233304.A32099@sharmas.dhs.org> <55vgjcqv87.wl@tripper.private> <20010825095746.A1015@sharmas.dhs.org> <55heuv0xtl.wl@tripper.private> <20010826171010.A6742@gnuppy> <20010827143244.A12305@misty.eyesbeyond.com> <55k7zqnd1x.wl@tripper.private>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 27, 2001 at 05:04:58PM +0900, Fuyuhiko Maruyama wrote: > What APIs are needed for ORP, Arun? How do you use NGPT for ORP? ORP was written for NT first and then ported to Linux. The approach they've taken is to emulate NT calls using the POSIX API: WaitForSingleObject CreateEvent See <orp>/os/<platform>/os_wrapper.c However, the suspend and resume APIs haven't been implemented for POSIX platforms. #if defined(ORP_NT) #define SUSPEND_THREAD(orpthread) SuspendThread((orpthread)->thread_handle) #define RESUME_THREAD(orpthread) ResumeThread((orpthread)->thread_handle) #elif defined(ORP_POSIX) // Linux asserts if these are called, signal logic TBD inline DWORD _enum_bad_call(){assert(0); return 1;} #define SUSPEND_THREAD(orpthread) _enum_bad_call() #define RESUME_THREAD(orpthread) _enum_bad_call() [..] However, NGPT supports most of them just fine. But as Dave Butenholf would advise you, don't use suspend/resume unless you know what you're doing :) A quick look at the NGPT implementation indicates that a thread currently using the CPU (and possibly holding some locks), will not be suspended and the suspend call fails with EPERM. -Arun $ grep _np pthread.h extern int pthread_attr_setname_np __P((pthread_attr_t *, char *)); extern int pthread_attr_getname_np __P((pthread_attr_t *, char **)); extern int pthread_attr_setprio_np __P((pthread_attr_t *, int)); extern int pthread_attr_getprio_np __P((pthread_attr_t *, int *)); extern int pthread_attr_setweight_np __P((pthread_attr_t *, int)); /*ibm*/ extern int pthread_attr_setsuspendstate_np __P((pthread_attr_t *, int)); /*ibm*/ extern int pthread_attr_getsuspendstate_np __P((pthread_attr_t *, int *)); /*ibm*/ extern int pthread_yield_np __P((void)); extern int pthread_suspend_np __P((pthread_t)); /*ibm*/ extern int pthread_resume_np __P((pthread_t)); /*ibm*/ extern int pthread_getstacksize_np __P((pthread_t, int *)); /*ibm*/ extern void * pthread_getcontext_np __P((pthread_t)); /*ibm*/ extern int pthread_bindtonative_np __P((pthread_t)); /*ibm*/ #define sched_yield pthread_yield_np #define pthread_yield pthread_yield_np #define pthread_attr_setprio pthread_attr_setprio_np #define pthread_attr_getprio pthread_attr_getprio_np To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010827095624.B14875>