Yongjin Kim skrev:
Is openSG thread safe with MFC application?

When I started openSG thread function with my MFC application, the button which pop up dialogs

doesn’t working properly anymore.

It seems the application goes into a deadlock.

After view the source code of “Thread::runFunction” I found that the opensg thread uses

CreateThread of Win32 API.

By MFC recommendation it is more desirable to use AfxBeginThread style thread, but actually with threads created by normal Win32 CreateThread whole program works well.

I really want to use this normal thread if I can. but as you know(?) in these threads, no FieldContainer objects can be created, i.e., when call NodePtr node = Node::create(), the program crashes.

Any help or suggestion?


You can always create your own threads (using whatever function) and then initialize OpenSG on that thread. There are a few previous posts about the exact syntax but I think that you want to do something like:

osg::Thread::getCurrentThread()->initialize(0); // or whatever aspect you want that thread to use

/Marcus


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to