PDA

View Full Version : Problems with crossplatformin



_diman
11-13-2012, 04:51 PM
Hi guys again,
I have reviewed the sources of ClanLib for create port on android and found that
1. There are different commands for install and uinstall services under the Windows and Unix
under the windows: -install / -uninstall
under the unix: -daemon
2. The method join for the CL_Thread have been different behavior on the Window and Unix:
under the windows: there are many threads can call this method for the same thread
under the unix: only one thread can call join for the thread

man pthread_join:

If multiple threads simultaneously try to join with the same thread, the results are undefined. If the thread calling pthread_join() is canceled, then the target thread will remain joinable (i.e., it will not be detached).

rombust
11-13-2012, 07:51 PM
1) "install and uninstall services". I am not familiar with the source code for that, but what you do say, it does appear inconsistant.

2) "CL_Thread". Only really a problem if an application tries to join a thread from multiple threads. I cannot think of a situation where someone would actually do that.
Normal usage is only the thread that created the worker thread will call join()

For interest, ClanLib 3.0 (under development) now has apple support. (And DirectX)
It may be worth visiting clanlib IRC ( http://webchat.freenode.net/?channels=clanlib ) to discuss ideas.
There are usually active developers in there at some point during the day

_diman
11-14-2012, 03:36 AM
1. Sorry for your confused. That's no a problem on the morning.
2. Yes, but ClanLib provide interface, which users can use. In this case the other threads are hang.
Example? Ok:
'main' thread starting resource loader thread
level is very big, so thread work along time
'main' thread starting background sound which processing in the 'sound' thread
'sound' thread wait while resource thread returned and automaticaly start playing (resource must be already loaded)
'main' thread popup a loading dialog, which localizated. So, it detected that the resource thread already exist, push request and wait it complited too

Under the windows all is work
But, when the user build his project is the linux, he must rewrite him code

The example is laboratory, but users can do this. And they all start new threads in the forum for resolving there problem.
At least comment must be added