Halley,
I have a little problem. I want to write a multithreaded server. So I create a server socket (So I try, but I not found some documentation), after I wait the client connection (in an unlimited cycle), and I create a new thread (next problem: How I create a new thread without array (I don't want controlling), (Example in java, I create a class from the Thread class and I create a dynamic thread (new thread(parameter))), so I give the socket to the thread (I think I use the constructor), and wait the nex connection (Don't need clear the socket variables, before I waiting the next client?)
Thanx.
Cow from Hu
Mailing lists / fpc-pascal / 2001-01
Thread + Inet
6 messages · 5 people · –
- MMarco van de Voort 2
- AAndrey Kubyshev 1
- Bboci 1
- PPeter Vreman 1
- RRoderick van Domburg 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Show quoted text 9 lines
There is a very basic implementation of the TThread class available in the FCL. Maybe it's enough for your program to run the socket functions with. But be carefull with other things as the RTL itself isn't multithreaded aware yet.
Peter
I have a little problem. I want to write a multithreaded server. So I create a server…
Hello boci,
Wednesday, January 03, 2001, 9:53:11 PM, you wrote:
boci> Halley,
boci> I have a little problem. I want to write a multithreaded server. boci> So I create a server socket (So I try, but I not found some boci> documentation), after I wait the client connection (in an unlimited boci> cycle), and I create a new thread (next problem: How I create a new thread boci> without array (I don't want controlling), (Example in java, I create a I think you cannot write stable multithreaded server for linux platform with current version of FPC. I spend a lot of time on it but it crashes sometimes anyway. I even used c memory manager and pthread library.
There is a very basic implementation of the TThread class available in the FCL. Maybe…
Show quoted text 15 lines
And neither are syscalls. So even if you try to use the unit Unix/Linux directly, it won't work.
Show quoted text 8 lines
Just a brainwave -- how about forking and using interprocess signals? I guess you couldn't send a lot of data back and forth between the instances, so you would need to come up with a way to publish addresses to unprotected memory areas. Too far fetched?
Show quoted text 13 lines
Yes. I think the language helpers are the biggest problem. Ordinary functions at least, you can protect with mutexes.
