On Linux, you want to use the pthread library.  The equivilent of
_createthread(...) in pthreads is pthread_create(...).  You will need to
include pthread.h.

For more info, check out

http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN.html

Also, if you want to keep everything portable and use the same code on
Windows and Linux, there is an LGPL pthread library for win32 at
http://sources.redhat.com/pthreads-win32/  They also have some links to
other tutorials.  You will need to distribute the dll and let people know
where the source is available, but those are minor inconveniences compared
to dozens of #ifdef WIN32s in your code ;)

Rob Prouse
http://www.tourofdutymod.com


At 06:53 PM 11/10/2002 +1000, you wrote:
>This is a multi-part message in MIME format.
>--
>[ Picked text/plain from multipart/alternative ]
>Following up from my post ages ago regarding making CPU threads...
>I managed to do it with _createthread, however this only works in win32.
>Is it possible to create a new CPU thread in the server dll under a linux
>environment?
>
>I have a mate assisting me with the linux compile:
>
>
> > > Hi,
> > >
> > > I looked for threads in halflife, cause the server crashes when creating
> > > a
> > >
> > > thread. And I found that:
> > > > nm engine_i386.so |grep -i Thread
> > >
> > > 0008eaa4 T NET_StartThread
> > > 0008eadc T NET_StopThread
> > > 0008e5b8 T NET_ThreadLock
> > > 0008e5c0 T NET_ThreadUnlock
> > >          w _pthread_cleanup_pop_restore
> > >          w _pthread_cleanup_push_defer
> > > 00395488 B dwNetThreadId
> > > 000b6efc D hNetThread
> > > 000b6d9c d net_thread_initialized
> > >          w pthread_mutex_lock
> > >          w pthread_mutex_unlock
> > > 000b6d98 D use_thread
> > >
> > > So HL uses threads internally. But they never call pthread_create to
> >
> > create a
> >
> > > thread. Maybe they are using another thread implementation and the two
> > > implementations doesn't like each other.
> > > I'll try to find a solution for that, but I think it will take some time.
> > > Maybe you have to contact sierra/valve for an answer.
>
>If someone could assist me with this, it would be greatly appreciated.
>
>Cheers guys,
>
>FragMented
>     HL Rally PR Manager
>     http://hlrally.net
>
>
>--
>
>_______________________________________________
>To unsubscribe, edit your list preferences, or view the list archives,
>please visit:
>http://list.valvesoftware.com/mailman/listinfo/hlcoders


Rob Prouse (Commando)
Tour of Duty Mod
http://www.tourofdutymod.com


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to