controll on cores from c, like this sleep() is a minimal controllBonita Montero pisze:
Real coroutines aren't possible with C since with native coroutines you
need functions that can be suspended and resumed.
c lasks some low lewel core management imo -it is more visible in
multicore times..but even in old times there was something like
interrupts - who allowed theoretically but probably also practically
freeze a branch and resume it - so somemechanics of multthreading
was even on 1core machines - i remember it was in 8-bit c64 really
Coroutines have nothing to do with multithreaded programming,
but they can be used to have sth. more lightweight than threading.
BTW it appeared to me that (as i said teh above it would be good to have
Bonita Montero pisze:> Am 11.06.2026 um 10:44 schrieb fir:
Bonita Montero pisze:
youReal coroutines aren't possible with C since with native coroutines
need functions that can be suspended and resumed.
c lasks some low lewel core management imo -it is more visible in
multicore times..but even in old times there was something like
interrupts - who allowed theoretically but probably also practically
freeze a branch and resume it - so somemechanics of multthreading
was even on 1core machines - i remember it was in 8-bit c64 really
Coroutines have nothing to do with multithreaded programming,controll on cores from c, like this sleep() is a minimal controll
but they can be used to have sth. more lightweight than threading.
BTW it appeared to me that (as i said teh above it would be good to have
function) that it would be nice to have something like that
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
//....
resume(core1);
or
if(core1 in foo) hold core1;
//etc
i mean other cores (or threads, maybe it should be threads) have its ip pointer (instruction pointer) so it would be just NICE to be able to
read it in another thread and just check where it is this avoidling LOCKS/mutexes
interesting idea imo
fir pisze:
Bonita Montero pisze:> Am 11.06.2026 um 10:44 schrieb fir:
coroutines you
Bonita Montero pisze:
Real coroutines aren't possible with C since with native
haveneed functions that can be suspended and resumed.
c lasks some low lewel core management imo -it is more visible in
multicore times..but even in old times there was something like
interrupts - who allowed theoretically but probably also practically
freeze a branch and resume it - so somemechanics of multthreading
was even on 1core machines - i remember it was in 8-bit c64 really
Coroutines have nothing to do with multithreaded programming,
but they can be used to have sth. more lightweight than threading.
BTW it appeared to me that (as i said teh above it would be good to
controll on cores from c, like this sleep() is a minimal controll
function) that it would be nice to have something like that
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
//....
resume(core1);
or
if(core1 in foo) hold core1;
//etc
i mean other cores (or threads, maybe it should be threads) have its ip
pointer (instruction pointer) so it would be just NICE to be able to
read it in another thread and just check where it is this avoidling
LOCKS/mutexes
interesting idea imo
it could be said that those locks /mutexes are in this respact idiotic becouse it makes you program blindly - like blind, becouse you dont know where your other threads are - where in fact it is an information
quite avaliable and instant...even it seems weird people was so blunt
to go in this blind mode ...but real assembly people like they say
somewhat died (fortunatelly im here ;c )
fir pisze:
Bonita Montero pisze:> Am 11.06.2026 um 10:44 schrieb fir:
coroutines you
Bonita Montero pisze:
Real coroutines aren't possible with C since with native
haveneed functions that can be suspended and resumed.
c lasks some low lewel core management imo -it is more visible in
multicore times..but even in old times there was something like
interrupts - who allowed theoretically but probably also practically
freeze a branch and resume it - so somemechanics of multthreading
was even on 1core machines - i remember it was in 8-bit c64 really
Coroutines have nothing to do with multithreaded programming,
but they can be used to have sth. more lightweight than threading.
BTW it appeared to me that (as i said teh above it would be good to
controll on cores from c, like this sleep() is a minimal controll
function) that it would be nice to have something like that
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
//....
resume(core1);
or
if(core1 in foo) hold core1;
//etc
i mean other cores (or threads, maybe it should be threads) have its ip
pointer (instruction pointer) so it would be just NICE to be able to
read it in another thread and just check where it is this avoidling
LOCKS/mutexes
interesting idea imo
it could be said that those locks /mutexes are in this respact idiotic becouse it makes you program blindly - like blind, becouse you dont know where your other threads are - where in fact it is an information
quite avaliable and instant...even it seems weird people was so blunt
to go in this blind mode ...but real assembly people like they say
somewhat died (fortunatelly im here ;c )
if(core1.ip >= foo.begin && core1.ip <= foo.end) hold(core1);
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
Lawrence D?Oliveiro pisze:
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
what race condition?
Lawrence D?Oliveiro pisze:
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
what race condition?
fir pisze:
Lawrence D?Oliveiro pisze:
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
what race condition?
it obviously is quite new situation - for example if you read IP of
another thread/core it still moves on forward so in such expressions
when you test IP it can be already not here - but it is all to be
handled, that what coding is
also im not sure if modern threads do not work like those old ones that
can be freezed on interrupts (?) that could be also problematic
but in old times i remember the interupts can be masked and unmasked
and yet probably this is not in case
still other methids of communication between threads are posiblle like
if thread is doin domething it sas flag wnen he presently is ilie
current_t1 = 'collisions'
/..
cirrent_t2 ='rasterizing';
//..
and˙ other thread can simply read it - i think if each tread only writes
its own current occupation flag and other only reads it it not bring collisions...it is also an option imo to align times of cpu to given microseconds (sorta like sleep bot not sleep(how many) but sleep( until time) - that could schedule conroll flow in time
overally this is quite good idea becouse it brings c to much lower lewel
of controll - where it should be
On 6/12/2026 4:22 AM, fir wrote:in c you know what is goin under the hood - to the extent of roughly
fir pisze:
Lawrence D?Oliveiro pisze:
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
what race condition?
it obviously is quite new situation - for example if you read IP of
another thread/core it still moves on forward so in such expressions
when you test IP it can be already not here - but it is all to be
handled, that what coding is
also im not sure if modern threads do not work like those old ones that
can be freezed on interrupts (?) that could be also problematic
but in old times i remember the interupts can be masked and unmasked
and yet probably this is not in case
still other methids of communication between threads are posiblle like
if thread is doin domething it sas flag wnen he presently is ilie
current_t1 = 'collisions'
/..
cirrent_t2 ='rasterizing';
//..
and˙ other thread can simply read it - i think if each tread only
writes its own current occupation flag and other only reads it it not
bring collisions...it is also an option imo to align times of cpu to
given microseconds (sorta like sleep bot not sleep(how many) but
sleep( until time) - that could schedule conroll flow in time
overally this is quite good idea becouse it brings c to much lower
lewel of controll - where it should be
Have you ever used C11 wrt its support for threads? No all that bad.
Pretty cool. Afaict, the only way we can simulate per-cpu is using
affinity masks (os specific) and cross our fingers that the OS keeps
them threads pinned down.
Chris M. Thomasson pisze:
On 6/12/2026 4:22 AM, fir wrote:in c you know what is goin under the hood - to the extent of roughly
fir pisze:
Lawrence D?Oliveiro pisze:
On Thu, 11 Jun 2026 22:50:58 +0200, fir wrote:
if(core1.ip >= foo.begin˙ && core1.ip <= foo.end) hold(core1);
?Knock-knock!?
?Race condition!?
?Who?s there??
what race condition?
it obviously is quite new situation - for example if you read IP of
another thread/core it still moves on forward so in such expressions
when you test IP it can be already not here - but it is all to be
handled, that what coding is
also im not sure if modern threads do not work like those old ones that
can be freezed on interrupts (?) that could be also problematic
but in old times i remember the interupts can be masked and unmasked
and yet probably this is not in case
still other methids of communication between threads are posiblle like
if thread is doin domething it sas flag wnen he presently is ilie
current_t1 = 'collisions'
/..
cirrent_t2 ='rasterizing';
//..
and˙ other thread can simply read it - i think if each tread only
writes its own current occupation flag and other only reads it it not
bring collisions...it is also an option imo to align times of cpu to
given microseconds (sorta like sleep bot not sleep(how many) but
sleep( until time) - that could schedule conroll flow in time
overally this is quite good idea becouse it brings c to much lower
lewel of controll - where it should be
Have you ever used C11 wrt its support for threads? No all that bad.
Pretty cool. Afaict, the only way we can simulate per-cpu is using
affinity masks (os specific) and cross our fingers that the OS keeps
them threads pinned down.
knowing assemblu, call conventions, stack working, how loops look like
and things like that (back day it was even better becouse now some
assembly debbuging come out of daily practice -
though i was doing it yet like 10 years ago etc - now indeed
i not do it to much (sadly)
with those threads from libraries the thing is different and its much
worse becouse you dont know the thing bac to te cpu
lewel as i mentioned - and that should be mended..
some need to establish the grounds how to do it
(multicore business)˙ on assembly level..and users/coders
need to know
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 4 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 494928:18:59 |
| Calls: | 162 |
| Files: | 568 |
| D/L today: |
14 files (349K bytes) |
| Messages: | 74,957 |